这是一个 Angular2 应用程序,组件在这里简化为:
@Component({
selector: 'courses',
template: `
<input [(ngModel)]="wahla">
<input [(ngModel)]="wahla">
{{ wahla }}
`
})
export class CoursesComponent {
wahla = "hmm hmm ha ha";
}
我认为应用程序在具有双向绑定的一个页面中运行良好,但是如果我使用http://localhost:3000/打开另一个选项卡,然后在第一页的第一个输入框中粘贴或键入某些内容,那么第二个选项卡实际上为其第一个输入框更新,而第二个输入框和静态文本不会更新。
对于第一个选项卡,一切都按预期更新。
这是应该发生的还是可能出了什么问题?这是使用npm start
运行带有 BrowserSync 的 lite-server 运行的。