Uncaught Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: false'. Current value: 'ngIf:
I have been trying to get updated value on clicking button after going to several sub pages with in the same component, YES and NO value does not update(Only on the current page it works), though I can see it through console log in my method. Below is my code. and I tried below URL
ngIf - Expression has changed after it was checked
constructor(
) {
}
getAssessBtn1(value: any) {
this.assesseeValidation = false;
if (value == 'Yes') {
this.showAssessBtn1 = true;
this.showAssessCondition1 = false;
} else {
this.showAssessBtn1 = false;
}
}
I was trying with ngAfterViewChecked, how can I use the method getAssessBtn1(value: any)
inside it.
HTML :
<button data-auto-id="AdultTravellersAssess" *ngIf="showAssessBtn1
class="btn btn-secondary assess-btn custom-theme-group-two"
(click)="test()">
Access