Difference between revisions of "AngularJS change detection"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(Created page with "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 componen...")
 
(No difference)

Latest revision as of 13:54, 31 December 2016

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