blob: 2ae40f3a9696a9b8d4f928f4b1ad32c2b377797e (
plain) (
tree)
|
|
import { Component } from '@angular/core'
import { CdkStep, CdkStepper } from '@angular/cdk/stepper'
@Component({
selector: 'my-custom-stepper',
templateUrl: './custom-stepper.component.html',
styleUrls: [ './custom-stepper.component.scss' ],
providers: [ { provide: CdkStepper, useExisting: CustomStepperComponent } ]
})
export class CustomStepperComponent extends CdkStepper {
onClick (index: number): void {
this.selectedIndex = index
}
isCompleted (step: CdkStep) {
return step.stepControl && step.stepControl.dirty && step.stepControl.valid
}
}
|