简体   繁体   English

如何使用反应式表单将静态数据提取到表单

[英]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. formArrayNameformControlName放在同一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.

相关问题 如何使用来自服务器的实时数据构建表单(使用 Angular 反应式 forms - 表单构建器) - How to construct a form (using Angular reactive forms - form builder) with live data coming from the server 如何在不使用反应式表单的情况下验证表单元素? - How to validate form element without using reactive forms? 如何使用反应式表单将表单绑定到 Angular 6 中的模型? - How can I bind a form to a model in Angular 6 using reactive forms? 如何使用角度反应形式将数据正确绑定到单选按钮? - how to correctly bind data to radio buttons using angular reactive forms? 如何使用 Angular8 中的反应形式将数据与单独的标头绑定 - How to bind the data with seperate headers using reactive forms in Angular8 使用响应式表单侦听表单中的更改值 - Listen for changes values in a form using Reactive Forms 如何使用反应式表单动态地将数据从组件设置到表单? - how to set data from component to the form dynamically using reactive form? 如何使用嵌套表单组验证反应式表单? - How to validate reactive forms with nested form groups? 如何以 Angular Reactive 形式获取复选框值 - How to fetch checkbox value in Angular Reactive form 重置表格(反应形式) - Reset Form (Reactive Forms)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM