angular 2 model driven nested form components

前端 未结 3 2081
走了就别回头了
走了就别回头了 2021-02-06 08:35

What I have:

I am building an ionic 2 app and have built a basic angular 2 component that contains

  • An input field

  • A lab

3条回答
  •  逝去的感伤
    2021-02-06 08:48

    What I did in my case (nested dynamic form as well) is somehow similar to Marcin's response.

    I'm passing existing FormGroup as parentForm and my Component's view looks like this:

    It suits my needs. Hope it can help you as well.

    UPDATE: I've created a library for speeding up dynamic forms creation. You can take a look to figure out how I use the technique from this answer: https://www.npmjs.com/package/dorf

提交回复
热议问题