Gretel Hendricks
Gretel Hendricks

Reputation: 393

Angular2 old forms module warning

I have created simple Angular2 application as mentioned in quick-start guide and then added couple of routes for navigation purpose.

In each of the components, i am displaying simple H1 tag indicating component1 and component2. This is to verify navigation happening correctly. My application works fine without any error. But I do receive one warning message in browser's chrome. I want to understand how to resolve this warning?

PLEASE NOTE: I am not using anything from @angular2/common or @angular/forms modules.

old forms module warning

My environment is-

Angular2 version: 2.0.0-rc.4

npm version: 3.9.6

node version: 4.4.7

Browser: chrome

Upvotes: 2

Views: 81

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657338

Add these providers to bootstrap:

import {disableDeprecatedForms, provideForms} from '@angular/forms';
bootstrap(AppComponent, [
   disableDeprecatedForms(),
   provideForms()
])

and don't import any forms stuff from @angular/common. Only import these from @angular/forms.

See also Angular 2 RC2 New Forms

Upvotes: 2

Related Questions