title: Form-Providers ngForm
body: <p>I've got the following problem. I want to work with NG2 Forms. According to the angular 2 documentation, using the ngForm directive on the form and the ngControl directive on the input, the form should always have access to the validity of the input.<br>
  &nbsp;<br>
  This works if the inputs are in the same component as the form, but as soon as I move the inputs into a child directive, they don't get the ngForm-Provider anymore.<br>
  &nbsp;<br>
  This works:  </p>
  
  <pre><code>import { Component, Input } from 'angular2/core';
  import { FORM_DIRECTIVES } from 'angular/common';
  
  @Component({
      directives: [FORM_DIRECTIVES],
      template: `
          &lt;form #heroForm="ngForm"&gt;
              &lt;input type="text"
                  [(ngModel)]="input.test"
                  ngControl="name"&gt;
          &lt;/form&gt;
      `
  })
  export class FormTest1 {
      public input = {
          test: ""
      }
  }
  </code></pre>
  
  <p>However, this doesn't:  </p>
  
  <pre><code>import { Component, Input } from 'angular2/core';
  import { FORM_DIRECTIVES } from 'angular/common';
  
  
  @Component({
      directives: [FORM_DIRECTIVES],
      template: `
          &lt;input *ngIf="data"
              [(ngModel)]="data.test"
              ngControl="name"&gt;
      `
  })
  export class FormInput {
      @Input() data;
  }
  
  @Component({
      directives: [FormInput, FORM_DIRECTIVES],
      template: `
          &lt;form #heroForm="ngForm"&gt;
              &lt;form-input
                  [data]="input"&gt;
              &lt;/form-input&gt;
          &lt;/form&gt;
      `
  })
  export class FormTest1 {
      public input = {
          test: ""
      }
  }
  </code></pre>
  
  <p>As this throws:  </p>
  
  <pre><code>EXCEPTION: No provider for t! (t -&gt; t) in [null]
  </code></pre>
  
  <p>As soon as I remove the ngControl-attribute from the input, the error disappears, but the form in the parent doesn't receive any information about the input anymore. How do I go about passing the ngForm down to the child component?<br>
  Thanks in advance.</p>