我已经在Android 6.0和7.0仿真设备中测试了* ngIf,并且模板未检测到更改。在+ version的其余版本中,我都能正常工作。
我还尝试了NGZone和ChangeDetectorRef方法来强制进行更改检测,但没有任何反应。这些是设备的详细信息:https://www.whatsmybrowser.org/b/37YYF86
@角度4.2.4
<!-- in the template -->
<div class="bottom-box" *ngIf="user"> ...user details </div>
// In the controller
ngOnInit() {
this.accountService.get()
.subscribe(
(user: User) => {
this.user = user;
},
(error) => console.log(error)
);
}