angular2 获取到的数据无法实时更新的问题

在修改完组件数据之后调用下面两句:

this.changeDetectorRef.markForCheck();  
this.changeDetectorRef.detectChanges();  

  

注入到构造函数

constructor(  
       private changeDetectorRef:ChangeDetectorRef  
   ){}  

  

原文地址:https://www.cnblogs.com/eleven24/p/8361857.html