Angular 2 nested forms with child components and validation

后端 未结 6 1260
醉话见心
醉话见心 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:55

    you can add an Input in your children component to pass the FormGroup to it.and use FormGroupName to pass the name of your FormGroup :)

    children.component.ts

    @Input('group');
    private dummyGroup: FormGroup;
    

    parent.component.html

提交回复
热议问题