@@ -197,7 +197,8 @@ const _MatDateRangeInputBase:
197
197
{ provide : NG_VALIDATORS , useExisting : MatStartDate , multi : true }
198
198
]
199
199
} )
200
- export class MatStartDate < D > extends _MatDateRangeInputBase < D > implements CanUpdateErrorState {
200
+ export class MatStartDate < D > extends _MatDateRangeInputBase < D > implements
201
+ CanUpdateErrorState , DoCheck , OnInit {
201
202
/** Validator that checks that the start date isn't after the end date. */
202
203
private _startValidator : ValidatorFn = ( control : AbstractControl ) : ValidationErrors | null => {
203
204
const start = this . _dateAdapter . getValidDateOrNull (
@@ -225,6 +226,26 @@ export class MatStartDate<D> extends _MatDateRangeInputBase<D> implements CanUpd
225
226
dateAdapter , dateFormats ) ;
226
227
}
227
228
229
+ ngOnInit ( ) {
230
+ // Normally this happens automatically, but it seems to break if not added explicitly when all
231
+ // of the criteria below are met:
232
+ // 1) The class extends a TS mixin.
233
+ // 2) The application is running in ViewEngine.
234
+ // 3) The application is being transpiled through tsickle.
235
+ // This can be removed once google3 is completely migrated to Ivy.
236
+ super . ngOnInit ( ) ;
237
+ }
238
+
239
+ ngDoCheck ( ) {
240
+ // Normally this happens automatically, but it seems to break if not added explicitly when all
241
+ // of the criteria below are met:
242
+ // 1) The class extends a TS mixin.
243
+ // 2) The application is running in ViewEngine.
244
+ // 3) The application is being transpiled through tsickle.
245
+ // This can be removed once google3 is completely migrated to Ivy.
246
+ super . ngDoCheck ( ) ;
247
+ }
248
+
228
249
protected _validator = Validators . compose ( [ ...super . _getValidators ( ) , this . _startValidator ] ) ;
229
250
230
251
protected _getValueFromModel ( modelValue : DateRange < D > ) {
@@ -282,7 +303,8 @@ export class MatStartDate<D> extends _MatDateRangeInputBase<D> implements CanUpd
282
303
{ provide : NG_VALIDATORS , useExisting : MatEndDate , multi : true }
283
304
]
284
305
} )
285
- export class MatEndDate < D > extends _MatDateRangeInputBase < D > implements CanUpdateErrorState {
306
+ export class MatEndDate < D > extends _MatDateRangeInputBase < D > implements
307
+ CanUpdateErrorState , DoCheck , OnInit {
286
308
/** Validator that checks that the end date isn't before the start date. */
287
309
private _endValidator : ValidatorFn = ( control : AbstractControl ) : ValidationErrors | null => {
288
310
const end = this . _dateAdapter . getValidDateOrNull ( this . _dateAdapter . deserialize ( control . value ) ) ;
@@ -309,6 +331,26 @@ export class MatEndDate<D> extends _MatDateRangeInputBase<D> implements CanUpdat
309
331
dateAdapter , dateFormats ) ;
310
332
}
311
333
334
+ ngOnInit ( ) {
335
+ // Normally this happens automatically, but it seems to break if not added explicitly when all
336
+ // of the criteria below are met:
337
+ // 1) The class extends a TS mixin.
338
+ // 2) The application is running in ViewEngine.
339
+ // 3) The application is being transpiled through tsickle.
340
+ // This can be removed once google3 is completely migrated to Ivy.
341
+ super . ngOnInit ( ) ;
342
+ }
343
+
344
+ ngDoCheck ( ) {
345
+ // Normally this happens automatically, but it seems to break if not added explicitly when all
346
+ // of the criteria below are met:
347
+ // 1) The class extends a TS mixin.
348
+ // 2) The application is running in ViewEngine.
349
+ // 3) The application is being transpiled through tsickle.
350
+ // This can be removed once google3 is completely migrated to Ivy.
351
+ super . ngDoCheck ( ) ;
352
+ }
353
+
312
354
protected _validator = Validators . compose ( [ ...super . _getValidators ( ) , this . _endValidator ] ) ;
313
355
314
356
protected _getValueFromModel ( modelValue : DateRange < D > ) {
0 commit comments