Before typescript files can be utilized, they must first be transpiled (converted) to Javascript. Browsers are unable to execute typescript directly, which is why the typescript compiler needs to be used. Due to this limitation, the server cannot monitor .ts
files as they are not executed directly.
Once converted to .js
, typescript functions just like any other Javascript code. To keep the server updated on browser activities, HTTP requests can be utilized as in standard website operations.
If you are running Javascript on a server (such as Node), it would be helpful if you provided more details for clarity. Your question seems a bit unclear.
This question is tagged with angular2
, suggesting that Typescript will be used in an Angular context. For guidance on getting started, I recommend checking out this resource.