我从Angular2开始,当我尝试第一次运行我的项目时,它可以正常工作。问题是,我正在关注教程,当我运行它时,任何浏览器都没有显示任何更改!VS angular2更改不会在浏览器上更新
这是我的 “app.component.ts”:
import {Component} from 'angular2/core';
@Component({
selector: 'my-app',
template: '<h1>Testing...</h1>'
})
export class AppComponent {
title = 'Tour of Heroes';
}
这表明在任何浏览器确定,但是当我改成这样:
import {Component} from 'angular2/core';
@Component({
selector: 'my-app',
template: '<h1>{{title}}</h1>'
})
export class AppComponent {
title = 'Tour of Heroes';
}
它继续显示“测试...“。它假设显示“英雄之旅”。为什么?
我所有的其他文件都与教程相同!
Ps .:我已经安装了“node和npm”!
[@PankajParkar提到需要编辑“System.config”的] 这就是我对我的index.html作为同在Angular2
<script>
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('app/main').then(null, console.error.bind(console));
</script>
尝试刷新浏览器缓存..或通过Ctrl + F5进行重新加载 –
我在发布之前做过搜索...... F5,Ctrl + F5甚至禁用缓存都不起作用! 当我更改我使用的端口时,它只更新一次,然后继续不更新... – Plinio
删除缓存或检查您的文件是否正确编译? –