Javascript 角度2-组件属性更改,但视图不更新

Javascript 角度2-组件属性更改,但视图不更新,javascript,angularjs,typescript,angular,setinterval,Javascript,Angularjs,Typescript,Angular,Setinterval,我正在努力学习Angular 2。我的理解是,当模型中相应的变量更新时,视图中的插值项会更新,但是在下面的代码中,我看不到这种行为 从'@angular/core'导入{Component,OnInit}; @组成部分({ 选择器:“ai头”, templateUrl:'app/header/header.component.html', 样式URL:['app/header/header.component.css'], }) 导出类HeaderComponent在Init上实现{ 当前时间

我正在努力学习Angular 2。我的理解是,当模型中相应的变量更新时,视图中的插值项会更新,但是在下面的代码中,我看不到这种行为

从'@angular/core'导入{Component,OnInit};
@组成部分({
选择器:“ai头”,
templateUrl:'app/header/header.component.html',
样式URL:['app/header/header.component.css'],
})
导出类HeaderComponent在Init上实现{
当前时间:日期=新日期();
getCurrentTime():void{
设dateTime=新日期();
让year=dateTime.getFullYear();
让month=dateTime.getMonth();
let day=dateTime.getDate();
设hour=dateTime.getHours();
让minute=dateTime.getMinutes();
设second=dateTime.getSeconds();
dateTime=新日期(年、月、日、小时、分钟、秒)
this.currentTime=日期时间;
}
ngOnInit():void{
setInterval(this.getCurrentTime,1000);
}   
}
我认为应该是:

ngOnInit(): void {
    setInterval(this.getCurrentTime.bind(this), 1000);
} 

这是正确的答案,我会尽快将其标记为正确答案。非常感谢您的快速回复。如果你有时间,你介意更详细地解释你的答案吗?