MCPcopy Create free account
hub / github.com/angular/components / _onLabelTextChange

Method _onLabelTextChange

src/material/checkbox/checkbox.ts:327–334  ·  view source on GitHub ↗

Method being called whenever the label text changes.

()

Source from the content-addressed store, hash-verified

325
326 /** Method being called whenever the label text changes. */
327 _onLabelTextChange() {
328 // Since the event of the `cdkObserveContent` directive runs outside of the zone, the checkbox
329 // component will be only marked for check, but no actual change detection runs automatically.
330 // Instead of going back into the zone in order to trigger a change detection which causes
331 // *all* components to be checked (if explicitly marked or not using OnPush), we only trigger
332 // an explicit change detection for the checkbox view and its children.
333 this._changeDetectorRef.detectChanges();
334 }
335
336 // Implemented as part of ControlValueAccessor.
337 writeValue(value: any) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected