cic-staff-client/src/app/pages/settings/organization/organization.component.ts

35 lines
948 B
TypeScript
Raw Normal View History

2020-11-25 08:59:48 +01:00
import { Component, OnInit } from '@angular/core';
2021-02-08 12:47:07 +01:00
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {CustomErrorStateMatcher} from '@app/_helpers';
2020-11-25 08:59:48 +01:00
@Component({
selector: 'app-organization',
templateUrl: './organization.component.html',
styleUrls: ['./organization.component.scss']
})
export class OrganizationComponent implements OnInit {
2021-02-08 12:47:07 +01:00
organizationForm: FormGroup;
submitted: boolean = false;
matcher = new CustomErrorStateMatcher();
2020-11-25 08:59:48 +01:00
2021-02-08 12:47:07 +01:00
constructor(
private formBuilder: FormBuilder
) { }
2020-11-25 08:59:48 +01:00
ngOnInit(): void {
2021-02-08 12:47:07 +01:00
this.organizationForm = this.formBuilder.group({
disbursement: ['', Validators.required],
transfer: '',
countryCode: ['', Validators.required]
});
2020-11-25 08:59:48 +01:00
}
2021-02-08 12:47:07 +01:00
get organizationFormStub(): any { return this.organizationForm.controls; }
onSubmit(): void {
this.submitted = true;
if (this.organizationForm.invalid) { return; }
this.submitted = false;
}
2020-11-25 08:59:48 +01:00
}