aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/signup/custom-stepper.component.ts
blob: 2ae40f3a9696a9b8d4f928f4b1ad32c2b377797e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
  }
}