Skip to content

Instantly share code, notes, and snippets.

@dontpaniclabsgists
Created November 12, 2021 14:22
Show Gist options
  • Save dontpaniclabsgists/8c2cc076e0b9cc37ccab53b0f2aee89e to your computer and use it in GitHub Desktop.
Save dontpaniclabsgists/8c2cc076e0b9cc37ccab53b0f2aee89e to your computer and use it in GitHub Desktop.
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