Skip to content

Commit ba68517

Browse files
committed
refactor(material/timepicker): fix strict property initialization errors
Updates the code to be compatible with strict property initialization.
1 parent af065e8 commit ba68517

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/material/timepicker/timepicker.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,8 +1425,8 @@ describe('MatTimepicker', () => {
14251425
imports: [MatTimepicker, MatTimepickerInput, MatTimepickerToggle],
14261426
})
14271427
class StandaloneTimepicker {
1428-
@ViewChild(MatTimepickerInput) input: MatTimepickerInput<Date>;
1429-
@ViewChild(MatTimepicker) timepicker: MatTimepicker<Date>;
1428+
@ViewChild(MatTimepickerInput) input!: MatTimepickerInput<Date>;
1429+
@ViewChild(MatTimepicker) timepicker!: MatTimepicker<Date>;
14301430
readonly value = signal<Date | null>(null);
14311431
readonly disabled = signal(false);
14321432
readonly interval = signal<string | null>(null);
@@ -1464,8 +1464,8 @@ class StandaloneTimepicker {
14641464
],
14651465
})
14661466
class TimepickerInFormField {
1467-
@ViewChild(MatTimepicker) timepicker: MatTimepicker<Date>;
1468-
@ViewChild(MatTimepickerToggle) toggle: MatTimepickerToggle<Date>;
1467+
@ViewChild(MatTimepicker) timepicker!: MatTimepicker<Date>;
1468+
@ViewChild(MatTimepickerToggle) toggle!: MatTimepickerToggle<Date>;
14691469
}
14701470

14711471
@Component({
@@ -1476,7 +1476,7 @@ class TimepickerInFormField {
14761476
imports: [MatTimepicker, MatTimepickerInput],
14771477
})
14781478
class TimepickerTwoWayBinding {
1479-
@ViewChild(MatTimepickerInput) input: MatTimepickerInput<Date>;
1479+
@ViewChild(MatTimepickerInput) input!: MatTimepickerInput<Date>;
14801480
readonly value = signal(new Date(2024, 0, 15, 10, 30, 0));
14811481
}
14821482

@@ -1492,8 +1492,8 @@ class TimepickerTwoWayBinding {
14921492
imports: [MatTimepicker, MatTimepickerInput, ReactiveFormsModule],
14931493
})
14941494
class TimepickerWithForms {
1495-
@ViewChild(MatTimepickerInput) input: MatTimepickerInput<Date>;
1496-
@ViewChild(MatTimepicker) timepicker: MatTimepicker<Date>;
1495+
@ViewChild(MatTimepickerInput) input!: MatTimepickerInput<Date>;
1496+
@ViewChild(MatTimepicker) timepicker!: MatTimepicker<Date>;
14971497
readonly control = new FormControl<Date | null>(null, [Validators.required]);
14981498
readonly min = signal<Date | null>(null);
14991499
readonly max = signal<Date | null>(null);
@@ -1514,7 +1514,7 @@ class TimepickerWithMultipleInputs {}
15141514
imports: [MatTimepicker],
15151515
})
15161516
class TimepickerWithoutInput {
1517-
@ViewChild(MatTimepicker) timepicker: MatTimepicker<Date>;
1517+
@ViewChild(MatTimepicker) timepicker!: MatTimepicker<Date>;
15181518
}
15191519

15201520
@Component({

0 commit comments

Comments
 (0)