Angular reactive form child component

北战南征 提交于 2019-12-24 11:28:19

问题


I would like create reusable input group component with DE/EN data.

I'm looking for, once all the mandatory fields are filled for EN and DE then submit button should get enabled. And also should get all the data in JSON format.

Here the sample https://stackblitz.com/edit/angular-avjyct?file=app/app.component.ts

I have been trying but stuck. Expert advise please?


回答1:


Looks like you wanted to pass string value to your child component but passed undefined instead:

[en]="label1_en"
      ^^^^^^^^^
there is no such property in your component.

You can pass string like:

[en]="'label1_en'"

or

en="label1_en"

Forked Stackblitz



来源:https://stackoverflow.com/questions/56541130/angular-reactive-form-child-component

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!