Registers a date selection model with the input.
(model: MatDateSelectionModel<S, D>)
| 207 | |
| 208 | /** Registers a date selection model with the input. */ |
| 209 | _registerModel(model: MatDateSelectionModel<S, D>): void { |
| 210 | this._model = model; |
| 211 | this._valueChangesSubscription.unsubscribe(); |
| 212 | |
| 213 | if (this._pendingValue) { |
| 214 | this._assignValue(this._pendingValue); |
| 215 | } |
| 216 | |
| 217 | this._valueChangesSubscription = this._model.selectionChanged.subscribe(event => { |
| 218 | if (this._shouldHandleChangeEvent(event)) { |
| 219 | const value = this._getValueFromModel(event.selection); |
| 220 | this._lastValueValid = this._isValidValue(value); |
| 221 | this._cvaOnChange(value); |
| 222 | this._onTouched(); |
| 223 | this._formatValue(value); |
| 224 | this.dateInput.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement)); |
| 225 | this.dateChange.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement)); |
| 226 | } |
| 227 | }); |
| 228 | } |
| 229 | |
| 230 | /** Opens the popup associated with the input. */ |
| 231 | protected abstract _openPopup(): void; |
nothing calls this directly
no test coverage detected