Starting from 2.0.0.rc6 :
forms : deprecated provideForms() and disableDeprecatedForms() functions provideForms() been removed. Please import FormsModule or ReactiveFormsModule from @angular/forms instead.
In short:
So add to your app.module.ts or its equivalent:
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
The absence of one of these modules can lead to errors, including the one you encountered:
Cannot bind to 'ngModel', as this is not a known property of 'input'.
Cannot bind to formGroup since this is not a known property of form
There is no directive with "exportAs" set to "ngForm"
If in doubt, you can provide both FormsModule and ReactiveFormsModule together, but they are fully functional separately. When you provide one of these modules, the default form directives and providers from this module will be available for the entire application.
Older forms using ngControl ?
If you have these modules in your @NgModule , you are probably using old directives such as ngControl , which is a problem because new forms do not have ngControl . It has been replaced more or less * by ngModel .
For example, the equivalent of <input ngControl="actionType"> is <input ngModel name="actionType"> , so change it in your template.
Similarly, exporting to controls is no longer ngForm , now it is ngModel . So, in your case, replace #actionType="ngForm" with #actionType="ngModel" .
Thus, the resulting template should be ( ===> where changed):
<div class="form-group"> <label for="actionType">Action Type</label> <select ===> ngModel ===> name="actionType" ===> #actionType="ngModel" id="actionType" class="form-control" required> <option value=""></option> <option *ngFor="let actionType of actionTypes" value="{{ actionType.label }}"> {{ actionType.label }} </option> </select> </div>
* More or less, because not all ngControl functions ngControl been ported to ngModel . Some have simply been deleted or become different. An example is the name attribute, the same case that you currently have.