@@ -198,6 +198,23 @@ export class MatStartDate<D> extends _MatDateRangeInputBase<D> implements CanUpd
198
198
null : { 'matStartDateInvalid' : { 'end' : end , 'actual' : start } } ;
199
199
}
200
200
201
+ constructor (
202
+ @Inject ( MAT_DATE_RANGE_INPUT_PARENT ) rangeInput : MatDateRangeInputParent < D > ,
203
+ elementRef : ElementRef < HTMLInputElement > ,
204
+ defaultErrorStateMatcher : ErrorStateMatcher ,
205
+ injector : Injector ,
206
+ @Optional ( ) parentForm : NgForm ,
207
+ @Optional ( ) parentFormGroup : FormGroupDirective ,
208
+ @Optional ( ) dateAdapter : DateAdapter < D > ,
209
+ @Optional ( ) @Inject ( MAT_DATE_FORMATS ) dateFormats : MatDateFormats ) {
210
+
211
+ // TODO(crisbeto): this constructor shouldn't be necessary, but ViewEngine doesn't seem to
212
+ // handle DI correctly when it is inherited from `MatDateRangeInputPartBase`. We can drop this
213
+ // constructor once ViewEngine is removed.
214
+ super ( rangeInput , elementRef , defaultErrorStateMatcher , injector , parentForm , parentFormGroup ,
215
+ dateAdapter , dateFormats ) ;
216
+ }
217
+
201
218
protected _validator = Validators . compose ( [ ...super . _getValidators ( ) , this . _startValidator ] ) ;
202
219
203
220
protected _getValueFromModel ( modelValue : DateRange < D > ) {
@@ -261,6 +278,23 @@ export class MatEndDate<D> extends _MatDateRangeInputBase<D> implements CanUpdat
261
278
null : { 'matEndDateInvalid' : { 'start' : start , 'actual' : end } } ;
262
279
}
263
280
281
+ constructor (
282
+ @Inject ( MAT_DATE_RANGE_INPUT_PARENT ) rangeInput : MatDateRangeInputParent < D > ,
283
+ elementRef : ElementRef < HTMLInputElement > ,
284
+ defaultErrorStateMatcher : ErrorStateMatcher ,
285
+ injector : Injector ,
286
+ @Optional ( ) parentForm : NgForm ,
287
+ @Optional ( ) parentFormGroup : FormGroupDirective ,
288
+ @Optional ( ) dateAdapter : DateAdapter < D > ,
289
+ @Optional ( ) @Inject ( MAT_DATE_FORMATS ) dateFormats : MatDateFormats ) {
290
+
291
+ // TODO(crisbeto): this constructor shouldn't be necessary, but ViewEngine doesn't seem to
292
+ // handle DI correctly when it is inherited from `MatDateRangeInputPartBase`. We can drop this
293
+ // constructor once ViewEngine is removed.
294
+ super ( rangeInput , elementRef , defaultErrorStateMatcher , injector , parentForm , parentFormGroup ,
295
+ dateAdapter , dateFormats ) ;
296
+ }
297
+
264
298
protected _validator = Validators . compose ( [ ...super . _getValidators ( ) , this . _endValidator ] ) ;
265
299
266
300
protected _getValueFromModel ( modelValue : DateRange < D > ) {
0 commit comments