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
Try one of these:
$rootScope.$digest()
-- i.e., check the full component tree$rootScope.$apply(callback)
-- i.e., evaluate the callback function inside the Angular zone. I think, but I'm not sure, that this ends up checking the full component tree after executing the callback function.$scope.$digest()
-- i.e., check only this component and its childrenYou can inject ApplicationRef
, NgZone
, or ChangeDetectorRef
into your component.