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

Method _propagateChanges

src/material/chips/chip-listbox.ts:318–330  ·  view source on GitHub ↗

Emits change event to set the model value.

()

Source from the content-addressed store, hash-verified

316
317 /** Emits change event to set the model value. */
318 private _propagateChanges(): void {
319 let valueToEmit: any = null;
320
321 if (Array.isArray(this.selected)) {
322 valueToEmit = this.selected.map(chip => chip.value);
323 } else {
324 valueToEmit = this.selected ? this.selected.value : undefined;
325 }
326 this._value = valueToEmit;
327 this.change.emit(new MatChipListboxChange(this, valueToEmit));
328 this._onChange(valueToEmit);
329 this._changeDetectorRef.markForCheck();
330 }
331
332 /**
333 * Deselects every chip in the listbox.

Callers 1

ngAfterContentInitMethod · 0.95

Calls 2

_onChangeMethod · 0.80
markForCheckMethod · 0.80

Tested by

no test coverage detected