中化加油站项目
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.

40 lines
1.1 KiB

import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@Component({
selector: 'app-criminal-records',
templateUrl: './criminal-records.component.html',
styleUrls: ['./criminal-records.component.scss']
})
export class CriminalRecordsComponent 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)
}
resetForm(e: MouseEvent): void {
e.preventDefault();
this.validateForm.reset();
for (const key in this.validateForm.controls) {
this.validateForm.controls[key].markAsPristine();
this.validateForm.controls[key].updateValueAndValidity();
}
}
list: any = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
}