* Register an input with this datepicker. * @param input The datepicker input to register with this datepicker. * @returns Selection model that the input should hook itself up to.
(input: C)
| 608 | * @returns Selection model that the input should hook itself up to. |
| 609 | */ |
| 610 | registerInput(input: C): MatDateSelectionModel<S, D> { |
| 611 | if (this.datepickerInput && (typeof ngDevMode === 'undefined' || ngDevMode)) { |
| 612 | throw Error('A MatDatepicker can only be associated with a single input.'); |
| 613 | } |
| 614 | this._inputStateChanges.unsubscribe(); |
| 615 | this.datepickerInput = input; |
| 616 | this._inputStateChanges = input.stateChanges.subscribe(() => this.stateChanges.next(undefined)); |
| 617 | return this._model; |
| 618 | } |
| 619 | |
| 620 | /** |
| 621 | * Registers a portal containing action buttons with the datepicker. |