1


I am trying to break up a form into multiple sections, with each section having its own Component.
The root component template has the <form #f="ngForm"> tag but I want another component's template to contain the <input ngControl="name"> tags.

When I do attempt this, angular throws "Template parse errors: No provider for ControlContainer"

I believe this is because the ngControl can't find a parent ngForm to attach to.

I have a plunker of what I am hoping to accomplish. It also throws the error on load. (http://plnkr.co/edit/pLGQpJGbT6PzxA43XiQa?p=preview)

It works if I use the FormBuilder to build up the form controls in the root component and passing the relevant controlGroup to the child component but I am wondering if there is a way of doing this cleaner.

1

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.