Skip to content

Commit dc3586e

Browse files
committed
Add 'valid' to MdStep for form validation
1 parent a42f2d9 commit dc3586e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/demo-app/stepper/stepper-demo.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h2>Linear Vertical Stepper Demo</h2>
4444

4545
<h2>Linear Vertical Stepper Demo</h2>
4646
<md-vertical-stepper>
47-
<md-step>
47+
<md-step [valid]="nameFormGroup.valid">
4848
<form [formGroup]="nameFormGroup">
4949
<ng-template mdStepLabel>Fill out your name</ng-template>
5050
<md-input-container>
@@ -61,13 +61,13 @@ <h2>Linear Vertical Stepper Demo</h2>
6161
</form>
6262
</md-step>
6363

64-
<md-step [disabled]="!nameFormGroup.valid">
64+
<md-step [valid]="phoneFormGroup.valid">
6565
<form [formGroup]="phoneFormGroup">
6666
<ng-template mdStepLabel>
6767
<div>Fill out your phone number</div>
6868
</ng-template>
6969
<md-input-container>
70-
<input mdInput placeholder="Phone number" formControlName="phoneFormCtrl" required>
70+
<input mdInput placeholder="Phone number" formControlName="phoneFormCtrl">
7171
<md-error>This field is required</md-error>
7272
</md-input-container>
7373
<div>
@@ -77,7 +77,7 @@ <h2>Linear Vertical Stepper Demo</h2>
7777
</form>
7878
</md-step>
7979

80-
<md-step [disabled]="!phoneFormGroup.valid">
80+
<md-step>
8181
<form>
8282
<ng-template mdStepLabel>Confirm your information</ng-template>
8383
Everything seems correct.

src/demo-app/stepper/stepper-demo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class StepperDemo {
4848
});
4949

5050
this.phoneFormGroup = new FormGroup({
51-
phoneFormCtrl: new FormControl('', Validators.required)
51+
phoneFormCtrl: new FormControl('')
5252
});
5353
}
5454
}

0 commit comments

Comments
 (0)