import { Component, OnInit } from '@angular/core'; import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {CustomErrorStateMatcher} from '@app/_helpers'; @Component({ selector: 'app-export-accounts', templateUrl: './export-accounts.component.html', styleUrls: ['./export-accounts.component.scss'] }) export class ExportAccountsComponent implements OnInit { exportForm: FormGroup; matcher = new CustomErrorStateMatcher(); submitted: boolean = false; constructor( private formBuilder: FormBuilder ) { } ngOnInit(): void { this.exportForm = this.formBuilder.group({ accountType: ['', Validators.required], transfers: [''] }); } get exportFormStub(): any { return this.exportForm.controls; } export(): void { this.submitted = true; if (this.exportForm.invalid) { return; } this.submitted = false; } }