angular2-wizard-angular-material
Version:
This is an Angular2 Form Wizard component. Just like any form wizard. You can define steps and control how each step works. You can enable/disable navigation button based on validity of the current step. Currently, the component only support basic functio
39 lines (31 loc) • 930 B
text/typescript
import { Component, Input, Output, EventEmitter } from '@angular/core';
({
selector: 'wizard-step',
template:
`
<div [hidden]="!isActive">
<ng-content></ng-content>
</div>
`
})
export class WizardStepComponent {
() title: string;
() hidden: boolean = false;
() isValid: boolean = true;
() showNext: boolean = true;
() showPrev: boolean = true;
() onNext: EventEmitter<any> = new EventEmitter<any>();
() onPrev: EventEmitter<any> = new EventEmitter<any>();
() onComplete: EventEmitter<any> = new EventEmitter<any>();
private _isActive: boolean = false;
isDisabled: boolean = true;
constructor() { }
('isActive')
set isActive(isActive: boolean) {
this._isActive = isActive;
this.isDisabled = false;
}
get isActive(): boolean {
return this._isActive;
}
}