Observers

API for observers

API reference for Angular CDK observers

import {ObserversModule} from '@angular/cdk/observers';

An injectable service that allows watching elements for changes to their content.

Methods
observe

Observe content changes on an element.

Parameters

element

Element

The element to observe for content changes.

Returns
Observable<MutationRecord[]>

observe

Observe content changes on an element.

Parameters

element

ElementRef<Element>

The element to observe for content changes.

Returns
Observable<MutationRecord[]>

Directive that triggers a callback whenever the content of its associated element has changed.

Selector: [cdkObserveContent]

Exported as: cdkObserveContent
Properties
Name Description
@Input()

debounce: number

Debounce interval for emitting the changes.

@Input('cdkObserveContentDisabled')

disabled: any

Whether observing content is disabled. This option can be used to disconnect the underlying MutationObserver until it is needed.

@Output('cdkObserveContent')

event: EventEmitter<MutationRecord[]>

Event emitted for each change in the element's content.