Skip to content

Commit 3a6584b

Browse files
committed
Modifiy example
1 parent 8fc6b18 commit 3a6584b

File tree

5 files changed

+32
-14
lines changed

5 files changed

+32
-14
lines changed

e2e/components/stepper-e2e.spec.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,23 @@ describe('stepper', () => {
1919
const previousButton = element.all(by.buttonText('Back'));
2020
const nextButton = element.all(by.buttonText('Next'));
2121

22-
expect(element(by.css('md-step-header[aria-selected="true"]')).getText()).toBe('1\nStep one');
22+
expect(element(by.css('md-step-header[aria-selected="true"]')).getText())
23+
.toBe('1\nFill out your name');
2324

2425
screenshot('start');
2526
nextButton.get(0).click();
2627

27-
expect(element(by.css('md-step-header[aria-selected="true"]')).getText()).toBe('2\nStep two');
28+
expect(element(by.css('md-step-header[aria-selected="true"]')).getText())
29+
.toBe('2\nFill out your address');
2830

2931
await browser.wait(ExpectedConditions.not(
3032
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
3133
screenshot('click next');
3234

3335
previousButton.get(0).click();
3436

35-
expect(element(by.css('md-step-header[aria-selected="true"]')).getText()).toBe('1\nStep one');
37+
expect(element(by.css('md-step-header[aria-selected="true"]')).getText())
38+
.toBe('1\nFill out your name');
3639

3740
await browser.wait(ExpectedConditions.not(
3841
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
@@ -74,7 +77,8 @@ describe('stepper', () => {
7477
let nextButton = element.all(by.buttonText('Next'));
7578
nextButton.get(0).click();
7679

77-
expect(element(by.css('md-step-header[aria-selected="true"]')).getText()).toBe('1\nStep one');
80+
expect(element(by.css('md-step-header[aria-selected="true"]')).getText())
81+
.toBe('1\nFill out your name');
7882
});
7983
});
8084
});

src/lib/stepper/stepper.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Angular Material's stepper provides a wizard-like workflow by dividing content into logical steps.
22

3+
<!-- example(stepper-overview) -->
4+
35
Material stepper builds on the foundation of the CDK stepper that is responsible for the logic
46
that drives a stepped workflow. Material stepper extends the CDK stepper and has Material Design
57
styling.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/** No CSS for this example */

src/material-examples/stepper-overview/stepper-overview-example.html

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,32 @@
22
<md-horizontal-stepper [linear]="isLinear">
33
<md-step [stepControl]="firstFormGroup">
44
<form [formGroup]="firstFormGroup">
5-
<ng-template mdStepLabel>Step one</ng-template>
6-
Content of step one
7-
<button md-button mdStepperNext>Next</button>
5+
<ng-template mdStepLabel>Fill out your name</ng-template>
6+
<md-form-field>
7+
<input mdInput placeholder="Last name, First name" formControlName="firstCtrl" required>
8+
</md-form-field>
9+
<div>
10+
<button md-button mdStepperNext>Next</button>
11+
</div>
812
</form>
913
</md-step>
1014
<md-step [stepControl]="secondFormGroup">
1115
<form [formGroup]="secondFormGroup">
12-
<ng-template mdStepLabel>Step two</ng-template>
13-
Content of step two
14-
<button md-button mdStepperPrevious>Back</button>
15-
<button md-button mdStepperNext>Next</button>
16+
<ng-template mdStepLabel>Fill out your address</ng-template>
17+
<md-form-field>
18+
<input mdInput placeholder="Address" formControlName="secondCtrl" required>
19+
</md-form-field>
20+
<div>
21+
<button md-button mdStepperPrevious>Back</button>
22+
<button md-button mdStepperNext>Next</button>
23+
</div>
1624
</form>
1725
</md-step>
1826
<md-step>
19-
<ng-template mdStepLabel>Step three</ng-template>
20-
Content of step three
21-
<button md-button mdStepperPrevious>Back</button>
27+
<ng-template mdStepLabel>Done</ng-template>
28+
You are now done.
29+
<div>
30+
<button md-button mdStepperPrevious>Back</button>
31+
</div>
2232
</md-step>
2333
</md-horizontal-stepper>

src/material-examples/stepper-overview/stepper-overview-example.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {FormBuilder, FormGroup, Validators} from '@angular/forms';
77
@Component({
88
selector: 'stepper-overview-example',
99
templateUrl: 'stepper-overview-example.html',
10+
styleUrls: ['stepper-overview-example.css']
1011
})
1112
export class StepperOverviewExample {
1213
isLinear = false;

0 commit comments

Comments
 (0)