Triggering change detection manually in Angular
https://stackoverflow.com/questions/34827334/triggering-change-detection-manually-in-angular
QuestionAnswer735answered Jan 16, 2016 at 16:09Try one of these: ApplicationRef.tick() - similar to AngularJS's $rootScope.$digest() -- i.e., check the full component tree NgZone.run(callback) - similar to $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. ChangeDetectorRef.detectChanges() - similar to $scope.$digest() -- i.e., check only this component and its children
ApplicationRef.tick() - similar to AngularJS's $rootScope.$digest() -- i.e., check the full component tree
NgZone.run(callback) - similar to $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.
ChangeDetectorRef.detectChanges() - similar to $scope.$digest() -- i.e., check only this component and its children
DA: 2 PA: 81 MOZ Rank: 37