Created
November 12, 2021 14:22
-
-
Save dontpaniclabsgists/8c2cc076e0b9cc37ccab53b0f2aee89e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { FormArray, FormBuilder, FormControl, Validators } from '@angular/forms'; | |
@Component({ | |
selector: 'app-company-view', | |
templateUrl: './company-view.component.html', | |
styleUrls: ['./company-view.component.scss'] | |
}) | |
export class CompanyViewComponent implements OnInit { | |
companyForm = this.fb.group({ | |
companyName: new FormControl('', [Validators.required]), | |
admins: this.fb.array([]) | |
}) | |
constructor(private fb: FormBuilder) { } | |
ngOnInit(): void { | |
} | |
get admins() { | |
return this.companyForm.controls["admins"] as FormArray; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment