You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
|
|
|
@Component({
|
|
|
|
selector: 'app-today-warning',
|
|
|
|
templateUrl: './today-warning.component.html',
|
|
|
|
styleUrls: ['./today-warning.component.scss']
|
|
|
|
})
|
|
|
|
export class TodayWarningComponent implements OnInit {
|
|
|
|
validateForm!: FormGroup;
|
|
|
|
constructor(private fb: FormBuilder) { }
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
this.validateForm = this.fb.group({
|
|
|
|
level: [null],
|
|
|
|
type: [null],
|
|
|
|
site: [null],
|
|
|
|
datePicker: [null]
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
submitForm(): void {
|
|
|
|
for (const i in this.validateForm.controls) {
|
|
|
|
this.validateForm.controls[i].markAsDirty();
|
|
|
|
this.validateForm.controls[i].updateValueAndValidity();
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(this.validateForm)
|
|
|
|
}
|
|
|
|
}
|