ChangeDetectorRef class

Provides influence over how change detection should execute for a component.

In practice, this is often used just for markForCheck, which sets a component that uses ChangeDetectionStrategy.OnPush as dirty for future change detection.

NOTE: This API is currently transitional. Please use carefully, and avoid methods that are marked @Deprecated(...), as they will be eventually removed entirely.

Constructors

ChangeDetectorRef()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

detach() → void
Detaches the component from the change detection hierarchy. [...]
@Deprecated('Use "changeDetection: ChangeDetectionStrategy.OnPush" instead')
detectChanges() → void
Forces synchronous change detection of this component and its children. [...]
@Deprecated('Breaks assumptions around change detection and will be removed')
markChildForCheck(Object child) → void
Invokes markForCheck on child's associated ChangeDetectorRef. [...]
markForCheck() → void
Marks this and all ChangeDetectionStrategy.OnPush ancestors as dirty. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
reattach() → void
Reattaches a component that was detach-ed previously from the hierarchy. [...]
@Deprecated('Use "changeDetection: ChangeDetectionStrategy.OnPush" instead')
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited