Skip to content

Commit 693751e

Browse files
committed
refactor(cdk/stepper): fix strict property initialization errors
Updates the code to be compatible with strict property initialization.
1 parent 7869d70 commit 693751e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/cdk/stepper/stepper.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ export type StepperOrientation = 'horizontal' | 'vertical';
6060
/** Change event emitted on selection changes. */
6161
export class StepperSelectionEvent {
6262
/** Index of the step now selected. */
63-
selectedIndex: number;
63+
selectedIndex!: number;
6464

6565
/** Index of the step previously selected. */
66-
previouslySelectedIndex: number;
66+
previouslySelectedIndex!: number;
6767

6868
/** The step instance now selected. */
69-
selectedStep: CdkStep;
69+
selectedStep!: CdkStep;
7070

7171
/** The step instance previously selected. */
72-
previouslySelectedStep: CdkStep;
72+
previouslySelectedStep!: CdkStep;
7373
}
7474

7575
/** The state of each step. */
@@ -115,7 +115,7 @@ export class CdkStep implements OnChanges {
115115
_displayDefaultIndicatorType: boolean;
116116

117117
/** Template for step label if it exists. */
118-
@ContentChild(CdkStepLabel) stepLabel: CdkStepLabel;
118+
@ContentChild(CdkStepLabel) stepLabel!: CdkStepLabel;
119119

120120
/** Forms that have been projected into the step. */
121121
@ContentChildren(
@@ -131,10 +131,10 @@ export class CdkStep implements OnChanges {
131131
protected _childForms: QueryList<Partial<NgForm | FormGroupDirective>> | undefined;
132132

133133
/** Template for step content. */
134-
@ViewChild(TemplateRef, {static: true}) content: TemplateRef<any>;
134+
@ViewChild(TemplateRef, {static: true}) content!: TemplateRef<any>;
135135

136136
/** The top level abstract control of the step. */
137-
@Input() stepControl: AbstractControl;
137+
@Input() stepControl!: AbstractControl;
138138

139139
/** Whether user has attempted to move away from the step. */
140140
get interacted(): boolean {
@@ -150,19 +150,19 @@ export class CdkStep implements OnChanges {
150150
readonly interactedStream: EventEmitter<CdkStep> = new EventEmitter<CdkStep>();
151151

152152
/** Plain text label of the step. */
153-
@Input() label: string;
153+
@Input() label!: string;
154154

155155
/** Error message to display when there's an error. */
156-
@Input() errorMessage: string;
156+
@Input() errorMessage!: string;
157157

158158
/** Aria label for the tab. */
159-
@Input('aria-label') ariaLabel: string;
159+
@Input('aria-label') ariaLabel!: string;
160160

161161
/**
162162
* Reference to the element that the tab is labelled by.
163163
* Will be cleared if `aria-label` is set at the same time.
164164
*/
165-
@Input('aria-labelledby') ariaLabelledby: string;
165+
@Input('aria-labelledby') ariaLabelledby!: string;
166166

167167
/** State of the step. */
168168
@Input()
@@ -329,13 +329,13 @@ export class CdkStepper implements AfterContentInit, AfterViewInit, OnDestroy {
329329
private _keyManager: FocusKeyManager<FocusableOption> | undefined;
330330

331331
/** Full list of steps inside the stepper, including inside nested steppers. */
332-
@ContentChildren(CdkStep, {descendants: true}) _steps: QueryList<CdkStep>;
332+
@ContentChildren(CdkStep, {descendants: true}) _steps!: QueryList<CdkStep>;
333333

334334
/** Steps that belong to the current stepper, excluding ones from nested steppers. */
335335
readonly steps: QueryList<CdkStep> = new QueryList<CdkStep>();
336336

337337
/** The list of step headers of the steps in the stepper. */
338-
@ContentChildren(CdkStepHeader, {descendants: true}) _stepHeader: QueryList<CdkStepHeader>;
338+
@ContentChildren(CdkStepHeader, {descendants: true}) _stepHeader!: QueryList<CdkStepHeader>;
339339

340340
/** List of step headers sorted based on their DOM order. */
341341
private _sortedHeaders = new QueryList<CdkStepHeader>();

0 commit comments

Comments
 (0)