嘿,在 Angular 4 中需要反应式表单的帮助。我已经声明了下一个 FormGroup:
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()
])
});
但我想在部门数组中嵌套其他数组。有这样的东西:
departments: [
{ department: 'test', roles:['rol1', 'rol2'] }
]
可以嵌套 FormArrays 吗?或者这样做的最佳方法是什么。