Skip to content

Commit

Permalink
Add enabling/disabling linear state of demo
Browse files Browse the repository at this point in the history
  • Loading branch information
jwshinjwshin committed Aug 8, 2017
1 parent e648c0e commit 2aa0344
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/cdk/stepper/stepper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ export class CdkStep {
selector: 'cdk-stepper',
host: {
'(focus)': '_focusStep()',
'(keydown)': '_onKeydown($event)',
'[linear]': 'linear',
'(keydown)': '_onKeydown($event)'
},
})
export class CdkStepper {
Expand All @@ -97,9 +96,7 @@ export class CdkStepper {
/** Whether the validity of previous steps should be checked or not. */
@Input()
get linear() { return this._linear; }
set linear(value: any) {
this._linear = coerceBooleanProperty(value);
}
set linear(value: any) { this._linear = coerceBooleanProperty(value); }
private _linear = false;

/** The index of the selected step. */
Expand Down
3 changes: 2 additions & 1 deletion src/demo-app/stepper/stepper-demo.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<h2>Linear Vertical Stepper Demo</h2>
<md-checkbox [(ngModel)]="isNonLinear">Disable linear mode</md-checkbox>
<form [formGroup]="formGroup">
<md-vertical-stepper formArrayName="formArray" linear>
<md-vertical-stepper formArrayName="formArray" [linear]="!isNonLinear">
<md-step formGroupName="0" [stepControl]="formArray.get([0])">
<ng-template mdStepLabel>Fill out your name</ng-template>
<md-input-container>
Expand Down
3 changes: 2 additions & 1 deletion src/demo-app/stepper/stepper-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import {Validators, FormBuilder, FormGroup} from '@angular/forms';
moduleId: module.id,
selector: 'stepper-demo',
templateUrl: 'stepper-demo.html',
styleUrls: ['stepper-demo.scss'],
styleUrls: ['stepper-demo.scss']
})
export class StepperDemo {
formGroup: FormGroup;
isNonLinear = false;

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

0 comments on commit 2aa0344

Please sign in to comment.