Angular 2 nested forms with child components and validation

后端 未结 6 1257
醉话见心
醉话见心 2021-02-05 13:16

I\'m trying achieve a nested form with validation in Angular 2, I\'ve seen posts and followed the documentation but I\'m really struggling, hope you can point me in the right di

6条回答
  •  深忆病人
    2021-02-05 13:37

    Not going to lie, don't know how I didn't find this post earlier.

    Angular 2: Form containing child component

    The solution is to bind the children component to the same formGroup, by passing the formGroup from the parent to the children as an Input.

    If anyone shares a piece of code to solve the problem in other way, I'll gladly accept it.

提交回复
热议问题