1
- < h2 > Linear Vertical Stepper Demo</ h2 >
2
1
< md-checkbox [(ngModel)] ="isNonLinear "> Disable linear mode</ md-checkbox >
2
+
3
+ < h3 > Linear Vertical Stepper Demo using a single form</ h3 >
3
4
< form [formGroup] ="formGroup ">
4
5
< md-vertical-stepper formArrayName ="formArray " [linear] ="!isNonLinear ">
5
6
< md-step formGroupName ="0 " [stepControl] ="formArray.get([0]) ">
@@ -42,19 +43,63 @@ <h2>Linear Vertical Stepper Demo</h2>
42
43
</ md-vertical-stepper >
43
44
</ form >
44
45
45
- < h2 > Vertical Stepper Demo</ h2 >
46
+ < h3 > Linear Horizontal Stepper Demo using a different form for each step</ h3 >
47
+ < md-horizontal-stepper [linear] ="!isNonLinear ">
48
+ < md-step [stepControl] ="nameFormGroup ">
49
+ < form [formGroup] ="nameFormGroup ">
50
+ < ng-template mdStepLabel > Fill out your name</ ng-template >
51
+ < md-form-field >
52
+ < input mdInput placeholder ="First Name " formControlName ="firstNameCtrl " required >
53
+ < md-error > This field is required</ md-error >
54
+ </ md-form-field >
55
+ < md-form-field >
56
+ < input mdInput placeholder ="Last Name " formControlName ="lastNameCtrl " required >
57
+ < md-error > This field is required</ md-error >
58
+ </ md-form-field >
59
+ < div >
60
+ < button md-button mdStepperNext > Next</ button >
61
+ </ div >
62
+ </ form >
63
+ </ md-step >
64
+
65
+ < md-step [stepControl] ="phoneFormGroup ">
66
+ < form [formGroup] ="phoneFormGroup ">
67
+ < ng-template mdStepLabel > Fill out your phone number</ ng-template >
68
+ < md-form-field >
69
+ < input mdInput placeholder ="Phone number " formControlName ="phoneCtrl " required >
70
+ < md-error > This field is required</ md-error >
71
+ </ md-form-field >
72
+ < div >
73
+ < button md-button mdStepperPrevious > Back</ button >
74
+ < button md-button mdStepperNext > Next</ button >
75
+ </ div >
76
+ </ form >
77
+ </ md-step >
78
+
79
+ < md-step >
80
+ < form >
81
+ < ng-template mdStepLabel > Confirm your information</ ng-template >
82
+ Everything seems correct.
83
+ < div >
84
+ < button md-button > Done</ button >
85
+ </ div >
86
+ </ form >
87
+ </ md-step >
88
+ </ md-horizontal-stepper >
89
+
90
+ < h3 > Vertical Stepper Demo</ h3 >
46
91
< md-vertical-stepper >
47
92
< md-step >
48
93
< ng-template mdStepLabel > Fill out your name</ ng-template >
49
- < md-input-container >
94
+ < md-form-field >
50
95
< input mdInput placeholder ="First Name ">
51
96
< md-error > This field is required</ md-error >
52
- </ md-input-container >
97
+ </ md-form-field >
53
98
54
- < md-input-container >
99
+ < md-form-field >
55
100
< input mdInput placeholder ="Last Name ">
56
101
< md-error > This field is required</ md-error >
57
- </ md-input-container >
102
+ </ md-form-field >
58
103
< div >
59
104
< button md-button mdStepperNext type ="button "> Next</ button >
60
105
</ div >
@@ -64,10 +109,10 @@ <h2>Vertical Stepper Demo</h2>
64
109
< ng-template mdStepLabel >
65
110
< div > Fill out your phone number</ div >
66
111
</ ng-template >
67
- < md-input-container >
112
+ < md-form-field >
68
113
< input mdInput placeholder ="Phone number ">
69
114
< md-error > This field is required</ md-error >
70
- </ md-input-container >
115
+ </ md-form-field >
71
116
< div >
72
117
< button md-button mdStepperPrevious type ="button "> Back</ button >
73
118
< button md-button mdStepperNext type ="button "> Next</ button >
@@ -78,10 +123,10 @@ <h2>Vertical Stepper Demo</h2>
78
123
< ng-template mdStepLabel >
79
124
< div > Fill out your address</ div >
80
125
</ ng-template >
81
- < md-input-container >
126
+ < md-form-field >
82
127
< input mdInput placeholder ="Address ">
83
128
< md-error > This field is required</ md-error >
84
- </ md-input-container >
129
+ </ md-form-field >
85
130
< div >
86
131
< button md-button mdStepperPrevious type ="button "> Back</ button >
87
132
< button md-button mdStepperNext type ="button "> Next</ button >
@@ -97,19 +142,19 @@ <h2>Vertical Stepper Demo</h2>
97
142
</ md-step >
98
143
</ md-vertical-stepper >
99
144
100
- < h2 > Horizontal Stepper Demo</ h2 >
145
+ < h3 > Horizontal Stepper Demo</ h3 >
101
146
< md-horizontal-stepper >
102
147
< md-step >
103
148
< ng-template mdStepLabel > Fill out your name</ ng-template >
104
- < md-input-container >
149
+ < md-form-field >
105
150
< input mdInput placeholder ="First Name ">
106
151
< md-error > This field is required</ md-error >
107
- </ md-input-container >
152
+ </ md-form-field >
108
153
109
- < md-input-container >
154
+ < md-form-field >
110
155
< input mdInput placeholder ="Last Name ">
111
156
< md-error > This field is required</ md-error >
112
- </ md-input-container >
157
+ </ md-form-field >
113
158
< div >
114
159
< button md-button mdStepperNext type ="button "> Next</ button >
115
160
</ div >
@@ -119,10 +164,10 @@ <h2>Horizontal Stepper Demo</h2>
119
164
< ng-template mdStepLabel >
120
165
< div > Fill out your phone number</ div >
121
166
</ ng-template >
122
- < md-input-container >
167
+ < md-form-field >
123
168
< input mdInput placeholder ="Phone number ">
124
169
< md-error > This field is required</ md-error >
125
- </ md-input-container >
170
+ </ md-form-field >
126
171
< div >
127
172
< button md-button mdStepperPrevious type ="button "> Back</ button >
128
173
< button md-button mdStepperNext type ="button "> Next</ button >
@@ -133,10 +178,10 @@ <h2>Horizontal Stepper Demo</h2>
133
178
< ng-template mdStepLabel >
134
179
< div > Fill out your address</ div >
135
180
</ ng-template >
136
- < md-input-container >
181
+ < md-form-field >
137
182
< input mdInput placeholder ="Address ">
138
183
< md-error > This field is required</ md-error >
139
- </ md-input-container >
184
+ </ md-form-field >
140
185
< div >
141
186
< button md-button mdStepperPrevious type ="button "> Back</ button >
142
187
< button md-button mdStepperNext type ="button "> Next</ button >
@@ -152,26 +197,26 @@ <h2>Horizontal Stepper Demo</h2>
152
197
</ md-step >
153
198
</ md-horizontal-stepper >
154
199
155
- < h2 > Horizontal Stepper Demo</ h2 >
200
+ < h3 > Horizontal Stepper Demo</ h3 >
156
201
< md-horizontal-stepper >
157
202
< md-step *ngFor ="let step of steps " [label] ="step.label ">
158
- < md-input-container >
203
+ < md-form-field >
159
204
< input mdInput placeholder ="Answer " [(ngModel)] ="step.content ">
160
- </ md-input-container >
205
+ </ md-form-field >
161
206
< div >
162
207
< button md-button mdStepperPrevious > Back</ button >
163
208
< button md-button mdStepperNext > Next</ button >
164
209
</ div >
165
210
</ md-step >
166
211
</ md-horizontal-stepper >
167
212
168
- < h2 > Horizontal Stepper Demo with Templated Label</ h2 >
213
+ < h3 > Horizontal Stepper Demo with Templated Label</ h3 >
169
214
< md-horizontal-stepper >
170
215
< md-step *ngFor ="let step of steps ">
171
216
< ng-template mdStepLabel > {{step.label}}</ ng-template >
172
- < md-input-container >
217
+ < md-form-field >
173
218
< input mdInput placeholder ="Answer " [(ngModel)] ="step.content ">
174
- </ md-input-container >
219
+ </ md-form-field >
175
220
< div >
176
221
< button md-button mdStepperPrevious > Back</ button >
177
222
< button md-button mdStepperNext > Next</ button >
0 commit comments