Angular - Change Detection
This Angular component does not update the view after a timer:
How to fix it so the UI updates correctly?
constructor(private zone: NgZone) {
this.zone.runOutsideAngular(() => {
setTimeout(() => {
this.counter++;
}, 1000);
});
}How to fix it so the UI updates correctly?
