我有两个锚点标签
<ul class="switchNav">
<li [ngClass]="!hidePanel2 ? 'active' : ''">
<a href="javascript:void(0)" (click) ="hideShowPanel(1)">panel 1</a>
</li>
<li [ngClass]="!hidePanel1? 'active' : ''">
<a href="javascript:void(0)" (click) ="hideShowPanel(2)">panel 2</a>
</li>
</ul>
.ts
hidePanel2: boolean = true;
hidePanel1: boolean = false;
hideShowPanel(check: number) {
if (check == 1) {
this.hidePanel2 = true;
this.hidePanel1 = false;
}
else {
this.hidePanel1 = false;
this.hidePanel2 = true;
}
}
当我点击锚点时,会抛出错误
ExpressionChangedAfterItHasBeenCheckedError
之前它是可以用的,但由于团队成员更新了某个模块,它停止工作了。
我已经谷歌过很多次,但无法使它工作。
请帮忙。
谢谢。