Skip to content

Commit 2aa0344

Browse files
committed
Add enabling/disabling linear state of demo
1 parent e648c0e commit 2aa0344

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/cdk/stepper/stepper.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ export class CdkStep {
8383
selector: 'cdk-stepper',
8484
host: {
8585
'(focus)': '_focusStep()',
86-
'(keydown)': '_onKeydown($event)',
87-
'[linear]': 'linear',
86+
'(keydown)': '_onKeydown($event)'
8887
},
8988
})
9089
export class CdkStepper {
@@ -97,9 +96,7 @@ export class CdkStepper {
9796
/** Whether the validity of previous steps should be checked or not. */
9897
@Input()
9998
get linear() { return this._linear; }
100-
set linear(value: any) {
101-
this._linear = coerceBooleanProperty(value);
102-
}
99+
set linear(value: any) { this._linear = coerceBooleanProperty(value); }
103100
private _linear = false;
104101

105102
/** The index of the selected step. */

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<h2>Linear Vertical Stepper Demo</h2>
2+
<md-checkbox [(ngModel)]="isNonLinear">Disable linear mode</md-checkbox>
23
<form [formGroup]="formGroup">
3-
<md-vertical-stepper formArrayName="formArray" linear>
4+
<md-vertical-stepper formArrayName="formArray" [linear]="!isNonLinear">
45
<md-step formGroupName="0" [stepControl]="formArray.get([0])">
56
<ng-template mdStepLabel>Fill out your name</ng-template>
67
<md-input-container>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import {Validators, FormBuilder, FormGroup} from '@angular/forms';
55
moduleId: module.id,
66
selector: 'stepper-demo',
77
templateUrl: 'stepper-demo.html',
8-
styleUrls: ['stepper-demo.scss'],
8+
styleUrls: ['stepper-demo.scss']
99
})
1010
export class StepperDemo {
1111
formGroup: FormGroup;
12+
isNonLinear = false;
1213

1314
steps = [
1415
{label: 'Confirm your name', content: 'Last name, First name.'},

0 commit comments

Comments
 (0)