Skip to content

Commit 29bb9ca

Browse files
committed
fix(stepper): make stepperOptions an optional parameter
1 parent 7ed2ce6 commit 29bb9ca

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/cdk/stepper/stepper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,10 @@ export class CdkStep implements OnChanges {
184184
return this.stepControl && this.stepControl.invalid;
185185
}
186186

187+
/** @breaking-change 8.0.0 remove the `?` after `stepperOptions` */
187188
constructor(
188189
@Inject(forwardRef(() => CdkStepper)) private _stepper: CdkStepper,
189-
@Optional() @Inject(MAT_STEPPER_GLOBAL_OPTIONS) stepperOptions: StepperOptions) {
190+
@Optional() @Inject(MAT_STEPPER_GLOBAL_OPTIONS) stepperOptions?: StepperOptions) {
190191
this._stepperOptions = stepperOptions ? stepperOptions : {};
191192
this._showError = !!this._stepperOptions.showError;
192193
this._displayDefaultIndicatorType = this._stepperOptions.displayDefaultIndicatorType !== false;

src/lib/stepper/stepper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ export class MatStep extends CdkStep implements ErrorStateMatcher {
6060
/** Content for step label given by `<ng-template matStepLabel>`. */
6161
@ContentChild(MatStepLabel) stepLabel: MatStepLabel;
6262

63+
/** @breaking-change 8.0.0 remove the `?` after `stepperOptions` */
6364
constructor(@Inject(forwardRef(() => MatStepper)) stepper: MatStepper,
6465
@SkipSelf() private _errorStateMatcher: ErrorStateMatcher,
65-
@Optional() @Inject(MAT_STEPPER_GLOBAL_OPTIONS) stepperOptions: StepperOptions) {
66+
@Optional() @Inject(MAT_STEPPER_GLOBAL_OPTIONS) stepperOptions?: StepperOptions) {
6667
super(stepper, stepperOptions);
6768
}
6869

0 commit comments

Comments
 (0)