I recently followed Zach's advice and set up a new project in Visual Studio 2015 using .NET 5 to run Angular 2 with Typescript. Everything seemed to be working fine, but I encountered a small issue:
MyApp.ts :
import { Component } from "angular2/core";
@Component({
selector: "my-app",
template: `
<div>Hello from Angular 2</div>
`
})
export class MyApp {
public constructor() {
}
}
After updating the template to display different text, such as
<div>Some text here</div>
, recompiling the project, and running it in the browser, the old template text - Hello from Angular 2 - still appeared. Upon checking the compiled MyApp.js
file, the changes were not reflected there either.
(I attempted to rebuild the project multiple times, as well as closing and reopening Visual Studio - the MyApp.ts
file was only compiled once, when it was initially created.)
Additional files: (that may help in resolving the issue)
tsconfig.json :
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"exclude": [
"node_modules"
]
}
Where could the problem be originating from? Angular? Typescript? Visual Studio 2015? In my opinion, it might have something to do with Typescript and its compilation process. Any suggestions?
P.S: Please note that this implementation does not function properly in Internet Explorer!
Progress: I have tried cleaning, rebuilding, and building the project again - while it does compile the .ts files, it doesn't provide a solution to the issue...