From 1d5342abc43df02cf0bd69b1e865c0f179182eef Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 29 May 2019 11:03:01 +0200 Subject: Multi step registration --- client/src/app/signup/custom-stepper.component.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 client/src/app/signup/custom-stepper.component.ts (limited to 'client/src/app/signup/custom-stepper.component.ts') diff --git a/client/src/app/signup/custom-stepper.component.ts b/client/src/app/signup/custom-stepper.component.ts new file mode 100644 index 000000000..2ae40f3a9 --- /dev/null +++ b/client/src/app/signup/custom-stepper.component.ts @@ -0,0 +1,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 + } +} -- cgit v1.2.3