且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Angular 2在formArrays上找不到具有未指定名称属性的控件

更新时间:2023-12-06 12:50:04

[formArrayName]="areas" 

并且仅使用

formArrayName="areas"

这是因为您正在尝试使用[ ]绑定变量,而实际上并没有.还要注意您的提交,应该是:

This, because with [ ] you are trying to bind a variable, which this is not. Also notice your submit, it should be:

(ngSubmit)="onSubmit(areasForm.value)"

而不是areasForm.values.