From 257bed1d10490efcfaa5efc594644c6664ca75ac Mon Sep 17 00:00:00 2001 From: Karel-Lodewijk Verdonck Date: Tue, 9 May 2017 17:57:28 +0200 Subject: [PATCH 1/2] Added a reset option, so you can reuse the wizard. --- src/wizard.component.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/wizard.component.ts b/src/wizard.component.ts index 20e8bb9..34ac15b 100644 --- a/src/wizard.component.ts +++ b/src/wizard.component.ts @@ -110,9 +110,19 @@ export class WizardComponent implements OnInit, AfterContentInit { } } + reset() { + this.activeStep = this.steps[0]; + for (let step of this.steps) { + step.isDisabled = true; + } + this.activeStep.isDisabled = false; + this.activeStep.isActive = true; + this._isCompleted = false; + } + complete() { - this.activeStep.onComplete.emit(); this._isCompleted = true; + this.activeStep.onComplete.emit(); } - + } From 3056b48e724dd5ab16e93e78c38b5925c611e30a Mon Sep 17 00:00:00 2001 From: Karel-Lodewijk Verdonck Date: Fri, 12 May 2017 14:09:46 +0200 Subject: [PATCH 2/2] Replaced tabs with spaces for consistent indentation --- src/wizard.component.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wizard.component.ts b/src/wizard.component.ts index 34ac15b..643c685 100644 --- a/src/wizard.component.ts +++ b/src/wizard.component.ts @@ -111,13 +111,13 @@ export class WizardComponent implements OnInit, AfterContentInit { } reset() { - this.activeStep = this.steps[0]; - for (let step of this.steps) { - step.isDisabled = true; - } - this.activeStep.isDisabled = false; + this.activeStep = this.steps[0]; + for (let step of this.steps) { + step.isDisabled = true; + } + this.activeStep.isDisabled = false; this.activeStep.isActive = true; - this._isCompleted = false; + this._isCompleted = false; } complete() {