MCPcopy Index your code
hub / github.com/angular/components / _propagateChanges

Method _propagateChanges

src/material/select/select.ts:1279–1293  ·  view source on GitHub ↗

Emits change event to set the model value.

(fallbackValue?: any)

Source from the content-addressed store, hash-verified

1277
1278 /** Emits change event to set the model value. */
1279 private _propagateChanges(fallbackValue?: any): void {
1280 let valueToEmit: any;
1281
1282 if (this.multiple) {
1283 valueToEmit = (this.selected as MatOption[]).map(option => option.value);
1284 } else {
1285 valueToEmit = this.selected ? (this.selected as MatOption).value : fallbackValue;
1286 }
1287
1288 this._value = valueToEmit;
1289 this.valueChange.emit(valueToEmit);
1290 this._onChange(valueToEmit);
1291 this.selectionChange.emit(this._getChangeEvent(valueToEmit));
1292 this._changeDetectorRef.markForCheck();
1293 }
1294
1295 /**
1296 * Highlights the selected item. If no option is selected, it will highlight

Callers 1

_onSelectMethod · 0.95

Calls 3

_getChangeEventMethod · 0.95
_onChangeMethod · 0.80
markForCheckMethod · 0.80

Tested by

no test coverage detected