D
D
Dmitry Shnyrev2017-02-06 00:12:01
Angular
Dmitry Shnyrev, 2017-02-06 00:12:01

How to bind ngForm and ngModel from different components (angular 2)?

I have a parent component (let's say FormComponent) which contains child components (InputComponent which already contains the input itself with ngModel). It turns out that the form is smeared on components. How to link them together? What I see now is that the parent form does not react in any way to events from ipnuts (ng-untouched ng-pristine ng-valid).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shnyrev, 2017-02-06
@dmnBrest

Stakeoverflow suggested using ControlValueAccessor
https://angular.io/docs/ts/latest/api/forms/index/...
https://blog.thoughtram.io/angular/2016/07/27/cust...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question