mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-19 22:48:08 +01:00
44 lines
888 B
TypeScript
44 lines
888 B
TypeScript
|
|
import { Component, OnInit } from '@angular/core';
|
||
|
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||
|
|
|
||
|
|
@Component({
|
||
|
|
selector: 'ngx-stepper',
|
||
|
|
templateUrl: 'stepper.component.html',
|
||
|
|
styleUrls: ['stepper.component.scss'],
|
||
|
|
})
|
||
|
|
export class StepperComponent implements OnInit {
|
||
|
|
|
||
|
|
firstForm: FormGroup;
|
||
|
|
secondForm: FormGroup;
|
||
|
|
thirdForm: FormGroup;
|
||
|
|
|
||
|
|
constructor(private fb: FormBuilder) {
|
||
|
|
}
|
||
|
|
|
||
|
|
ngOnInit() {
|
||
|
|
this.firstForm = this.fb.group({
|
||
|
|
firstCtrl: ['', Validators.required],
|
||
|
|
});
|
||
|
|
|
||
|
|
this.secondForm = this.fb.group({
|
||
|
|
secondCtrl: ['', Validators.required],
|
||
|
|
});
|
||
|
|
|
||
|
|
this.thirdForm = this.fb.group({
|
||
|
|
thirdCtrl: ['', Validators.required],
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
onFirstSubmit() {
|
||
|
|
this.firstForm.markAsDirty();
|
||
|
|
}
|
||
|
|
|
||
|
|
onSecondSubmit() {
|
||
|
|
this.secondForm.markAsDirty();
|
||
|
|
}
|
||
|
|
|
||
|
|
onThirdSubmit() {
|
||
|
|
this.thirdForm.markAsDirty();
|
||
|
|
}
|
||
|
|
}
|