levi
levi
KPCKevin Powell - Community
Created by levi on 12/13/2023 in #front-end
Angular Change Detection
// component 1
<button (click)="open()">Click</button>
// 1 ts
open(){
this.appService.buttonClicked = true; // appServic is global provider
}

// component 2
<div [ngClass]={ 'disabled' : appService.buttonClicked }>
</div>
// component 1
<button (click)="open()">Click</button>
// 1 ts
open(){
this.appService.buttonClicked = true; // appServic is global provider
}

// component 2
<div [ngClass]={ 'disabled' : appService.buttonClicked }>
</div>
this is simple example for what I'm trying to achieve this is working Fine but I'm getting this exception ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'disabled: true'. Current value: 'disabled: false'
Idk how to solve this
1 replies
KPCKevin Powell - Community
Created by levi on 11/18/2023 in #front-end
using async on ngOnInit
No description
2 replies