<span *ngIf="displayProgressBar">
<c-progress-bar color='primary' [progress]=ocrProgress>
</c-progress-bar>
</span>
默认此变量是inicialize
displayProgressBar: boolean = false;
在某些方法中,我更改了值,视图显示
someMethodExecuteFirst() {
this.displayProgressBar = true;
}
接下来我执行第二种方法和
someMethodExecuteSecond() {
this.displayProgressBar = false;
console.log(this.displayProgressBar); // false
}
但HTML视图仍然可见。可能是什么原因?