S3E3 What's the difference between markForCheck() and detectChanges()

Stepan Suvorov
Stepan Suvorov
8.4 هزار بار بازدید - 4 سال پیش - If you don't switch off
If you don't switch off NgZone the difference between markForCheck() and detectChanges() is hardly visible.  markForCheck() is made for OnPush change detection strategy to let ChangeDetector know that component needs to be checked even if its inputs are the same. detectChanges() is mostly used in combination with detach(), when you want to perform local change detection checks.

Official docs:
https://angular.io/api/core/ChangeDet...

Code: https://github.com/stevermeister/Angu...

Angular Pro Screencasts Roadmap - https://github.com/stevermeister/Angu...

If you have any question or suggestion please put a comment, or ping me on Twitter - Twitter: stevermeister
4 سال پیش در تاریخ 1399/09/29 منتشر شده است.
8,438 بـار بازدید شده
... بیشتر