AngularJS change detection

From Wiki @ Karl Jones dot com
Jump to: navigation, search

In AngularJS, a change detection checks for changes in the data model so that it can re-render the DOM.

Changes are caused by events, XHR, and times.

Each component has its own change detector.

Use ChangeDetectionStrategy.OnPush along with immutable objects and/or observables.

To checka particular component, inject ChangeDetectorRef and call markForCheck.

See also