I\'m writing an Angular component that has a property Mode(): string
.
I would like to be able to set this property programmatically not in response to a
I used accepted answer reference and would like to put an example, since Angular 2 documentation is very very hard to read, I hope this is easier:
Import NgZone
:
import { Component, NgZone } from '@angular/core';
Add it to your class constructor
constructor(public zone: NgZone, ...args){}
Run code with zone.run
:
this.zone.run(() => this.donations = donations)