[英]How to fetch the static data to the form using reactive forms
I have a reactive form, on click of new button, i am able to get the same section again. 我有一个反应式表单,单击新按钮后,我可以再次获得相同的部分。 But here the options in the select field doesnt show up and also, i get an error as soon as page loads.
但是在这里,选择字段中的选项没有显示,而且,页面加载后我立即收到错误消息。
ERROR Error: Cannot find control with path: 'itemRows -> ContactName'
错误错误:找不到路径为“ itemRows-> ContactName”的控件
ERROR Error: Cannot find control with path: 'itemRows -> Phone'
错误错误:找不到路径为“ itemRows-> Phone”的控件
ERROR Error: Cannot find control with path: 'itemRows -> Relationship'
错误错误:找不到路径为“ itemRows-> Relationship”的控件
Can anyone help me to solve this issue and help me to get dropdown list in Relationship. 谁能帮助我解决此问题并帮助我获得“关系”中的下拉列表。
On everytime page load i get that error and also data inside drop down also not visible. 每次页面加载时,我都会收到该错误,而且下拉菜单中的数据也不可见。 Please help
请帮忙
It's not a good idea to put both formArrayName
and formControlName
on the same HTML node. 将
formArrayName
和formControlName
放在同一HTML节点上不是一个好主意。 Try to follow the pattern as described in the FormArrayName
documentation . 尝试遵循
FormArrayName
文档中所述的模式。 In your case, I'd start by putting formArrayName="itemRows"
on a new div
that is one level higher. 在您的情况下,我首先将
formArrayName="itemRows"
放在新的div
上,该div
更高一级。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.