Thursday, April 26, 2018

One may use .markForCheck() instead of .detectChanges() off of a ChangeDetectorRef in an Angular 4 application.

If you change a property on an Input but not the whole object in the manner that would normally tigger change detection in a OnPush ChangeDetectionStrategy circumstance, that will not kick off a refreshing. You may do so with .markForCheck() as explained here. I guess it has a narrower scope than .detectChanges() which I think is going to find anything that changed.

No comments:

Post a Comment