title: Angular 2 - form group component
body: <p>I'm trying to build a data-driven form, with inputs coming from another component, like this:</p>
  
  <pre><code>&lt;form [formGroup]="signupForm" (ngSubmit)="onSubmit()"&gt;
      &lt;app-form-group [name]="name"&gt;&lt;/app-form-group&gt;
      &lt;app-form-group [name]="email"&gt;&lt;/app-form-group&gt;
      &lt;app-form-group [name]="other"&gt;&lt;/app-form-group&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The <code>app-form-group</code> component will look something like this:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
      &lt;label class="col-md-2 control-label"&gt;{{Name}}&lt;/label&gt;
      &lt;div class="col-md-9"&gt;
    &lt;input class="form-control" [name]="name" [formControlName]="formCtrlName"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>The problem is that <code>formControlName</code> needs a <code>formGroup</code>directive, therefore I get this error:</p>
  
  <pre><code>Error : Error in ./FormGroupComponent class FormGroupComponent - inline template:3:58 caused by: formControlName must be used with a parent formGroup directive.You'll want to add a formGroup
     directive and pass it an existing FormGroup instance (you can create one in your class).
  </code></pre>
  
  <p>Is there any way to get around this issue?</p>