From e9a9b4b4fd167c2525c0cab4644655c4e4bdebe8 Mon Sep 17 00:00:00 2001 From: Ji Won Shin Date: Tue, 8 Aug 2017 15:02:31 -0700 Subject: [PATCH] Add [stepControl] to each step based on merging --- src/cdk/stepper/stepper.ts | 2 +- src/demo-app/stepper/stepper-demo.html | 31 +++++++++++++------------- src/demo-app/stepper/stepper-demo.ts | 6 ++--- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/cdk/stepper/stepper.ts b/src/cdk/stepper/stepper.ts index 807369e1f87d..3e33a1bd5c51 100644 --- a/src/cdk/stepper/stepper.ts +++ b/src/cdk/stepper/stepper.ts @@ -209,7 +209,7 @@ export class CdkStepper { stepsArray[this._selectedIndex].interacted = true; if (this._linear) { for (let i = 0; i < index; i++) { - if (!stepsArray[i].stepControl.valid) { + if (stepsArray[i].stepControl.invalid) { return true; } } diff --git a/src/demo-app/stepper/stepper-demo.html b/src/demo-app/stepper/stepper-demo.html index 56f4add44b54..88c98fe76762 100644 --- a/src/demo-app/stepper/stepper-demo.html +++ b/src/demo-app/stepper/stepper-demo.html @@ -1,5 +1,6 @@ -

Linear Vertical Stepper Demo

Disable linear mode + +

Linear Vertical Stepper Demo using FormArray

@@ -42,17 +43,17 @@

Linear Vertical Stepper Demo

-

Linear Vertical Stepper Demo

- - +

Linear Horizontal Stepper Demo using multiple FormGroups

+ +
Fill out your name - + This field is required - + This field is required
@@ -61,13 +62,11 @@

Linear Vertical Stepper Demo

- +
- -
Fill out your phone number
-
+ Fill out your phone number - + This field is required
@@ -86,9 +85,9 @@

Linear Vertical Stepper Demo

- + -

Vertical Stepper Demo

+

Vertical Stepper Demo

Fill out your name @@ -143,7 +142,7 @@

Vertical Stepper Demo

-

Horizontal Stepper Demo

+

Horizontal Stepper Demo

Fill out your name @@ -198,7 +197,7 @@

Horizontal Stepper Demo

-

Horizontal Stepper Demo

+

Horizontal Stepper Demo

@@ -211,7 +210,7 @@

Horizontal Stepper Demo

-

Horizontal Stepper Demo with Templated Label

+

Horizontal Stepper Demo with Templated Label

{{step.label}} diff --git a/src/demo-app/stepper/stepper-demo.ts b/src/demo-app/stepper/stepper-demo.ts index b9d0aba261be..367feecb6e56 100644 --- a/src/demo-app/stepper/stepper-demo.ts +++ b/src/demo-app/stepper/stepper-demo.ts @@ -43,12 +43,12 @@ export class StepperDemo { }); this.nameFormGroup = new FormGroup({ - firstNameFormCtrl: new FormControl('', Validators.required), - lastNameFormCtrl: new FormControl('', Validators.required) + firstNameCtrl: new FormControl('', Validators.required), + lastNameCtrl: new FormControl('', Validators.required) }); this.phoneFormGroup = new FormGroup({ - phoneFormCtrl: new FormControl('') + phoneCtrl: new FormControl('') }); } }