This is the structure of my ComplaintCreateComponent.ts
file.
import { Component, OnInit } from '@angular/core';
import { FormBuilder, Validators } from '@angular/forms';
...
export class ComplaintCreateComponent implements OnInit {
public ComplaintForm = this.formBuilder.group({
ComplaintID: ['', [Validators.required]],
FileNo: ['', [Validators.required]],
ComplaintName: ['', Validators.required],
})
constructor(private formBuilder: FormBuilder) { }
ngOnInit(): void {}
onSubmit() {
console.log(this.ComplaintForm);
}
}
I want to move these options into a separate .ts file and import it in the this.formBuilder.group
settings.
{
ComplaintID: ['', [Validators.required]],
FileNo: ['', [Validators.required]],
ComplaintName: ['', Validators.required],
}