Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private doActivate(step: TdStepComponent) {
// Disable all steps greater than the current step
const steps = this.stepper.steps;
const index = steps.indexOf(step);
const disabled = this.disabledSteps.value;
for (let i = 0; i < steps.length; i++) {
const current = steps[i];
current.disabled = disabled.has(current) || i > index;
if (i > index) {
current.state = StepState.None;
} else if (i < index) {
if (this.disabledSteps.value.has(current)) {
current.state = StepState.None;
} else {
current.state = StepState.Complete;
}
}
}
step.state = StepState.None;
step.open();
}
}
setShop(data: RetailShop) {
this.shop = data;
this.stateStep1 = StepState.Complete;
this.state = 2;
}
}
triageFormGroup: FormGroup;
yesno = [
{name: 'Yes', viewValue: 0},
{name: 'No', viewValue: 1}
];
sexes = [
{name: 'Female', viewValue: 'female'},
{name: 'Male', viewValue: 'male'}
];
activeDeactiveStep1Msg: string = 'No select/deselect detected yet';
stateStep2: StepState = StepState.Required;
stateStep3: StepState = StepState.Complete;
disabled: boolean = false;
toggleRequiredStep2(): void {
this.stateStep2 = (this.stateStep2 === StepState.Required ? StepState.None : StepState.Required);
}
toggleCompleteStep3(): void {
this.stateStep3 = (this.stateStep3 === StepState.Complete ? StepState.None : StepState.Complete);
}
activeStep1Event(): void {
this.activeDeactiveStep1Msg = 'Active event emitted.';
}
deactiveStep1Event(): void {
this.activeDeactiveStep1Msg = 'Deactive event emitted.';