Hey need help with reactive forms in Angular 4. I've got the next FormGroup declared:
userForm:FormGroup = new FormGroup ({
employeenumber: new FormControl(),
name: new FormControl(),
lastname: new FormControl(),
birthdate: new FormControl(),
phone: new FormControl(),
email: new FormControl(),
username: new FormControl(),
password: new FormControl(),
blocked: new FormControl(),
departments: new FormArray([
new FormControl()
])
});
But I want to nest other array inside the departments array. To have something like this:
departments: [
{ department: 'test', roles:['rol1', 'rol2'] }
]
It is possible to nest FormArrays? or what is the best way of doing this.