Angular 2 error- There is no directive with "exportAs" set to "ngModel" with RC4 version
<p>I am using angular 2 forms in my application and i have created the forms based on given link.</p>

<p><a href="https://angular.io/docs/ts/latest/guide/forms.html" rel="nofollow noreferrer">https://angular.io/docs/ts/latest/guide/forms.html</a></p>

<p>In this for validation and to use forms APIs, i have set the <code>ngModel</code> values like <code>#name="id"  #id="ngModel"</code> and which throws script error. But its resolved if i set  <code>#id="ngModel"</code> as <code>#id="ngForm"</code>. But for my case i have to set my model value to <code>ngModel</code>. </p>

<p>Below is my html page.</p>

<pre><code> &lt;form (ngSubmit)="onSubmit()" #myForm="ngForm"&gt;
  &lt;div class="form-group"&gt;
  &lt;label class="control-label" for="id"&gt;Employee ID&lt;/label&gt;
    &lt;input type="text" class="form-control" required [(ngModel)]="model.id" #name="id"  #id="ngModel" &gt;
    &lt;div [hidden]="id.valid || id.pristine" class="alert alert-danger"&gt;
      Employee ID is required
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
    &lt;label for="name"&gt;Employee Name&lt;/label&gt;
    &lt;input type="text" class="form-control" [(ngModel)]="model.name" name="name" #name="ngModel" required&gt;
        &lt;div [hidden]="name.valid || name.pristine" class="alert alert-danger"&gt;
      Employee ID is required
        &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
    &lt;label for="DOJ"&gt;DOJ&lt;/label&gt;
    &lt;input class="form-control" required [(ngModel)]="model.DOJ" name="DOJ" #DOJ="ngModel"  /&gt;
    &lt;div [hidden]="DOJ.valid || DOJ.pristine" class="alert alert-danger"&gt;
      DOJ is required
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;button type="submit" class="btn btn-default" [disabled]="!myForm.form.valid"&gt;Submit&lt;/button&gt;
&lt;/form&gt;
</code></pre>

<p>Below is my issue.</p>

<pre><code>      EXCEPTION: Template parse errors:
       There is no directive with "exportAs" set to "ngModel" ("
         &lt;div&gt;
          &lt;h1&gt;My Form&lt;/h1&gt;
             &lt;form (ngSubmit)="onSubmit()" [ERROR -&gt;]#myForm="ngModel"&gt;
             &lt;div class="form-group&gt;
            &lt;label class="control-label" for="id"&gt;Employee"):AppComponent@3:34
</code></pre>

<p>I have checked with more questions and answers, most of them said to update angular2 version to <code>RC4</code> so i have updated my application to rc4 but still i am facing this issue.</p>

<p>Below is my ts file:</p>

<pre><code>import {Component} from '@angular/core';
import { disableDeprecatedForms, provideForms , NgForm} from '@angular/forms';
import {CORE_DIRECTIVES, FORM_DIRECTIVES, FormBuilder,Validators,Control,ControlGroup } from '@angular/common';


@Component({
selector: 'ej-app',    
templateUrl: 'app/app.component.html',
directives: [ CORE_DIRECTIVES,FORM_DIRECTIVES]  
})
  export class AppComponent {
  model = new Employees(null,'','');
    onSubmit() { alert("values submitted")}
   constructor() {
     }
     }
        export class Employees {
         constructor( public id: number,public name: string, public DOJ: String ) {  }
}
</code></pre>