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