Emits change event to set the model value.
(fallbackValue?: any)
| 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 |
no test coverage detected