Reputation: 10386
As suggested in article:
https://docs.google.com/document/u/1/d/1RIezQqE4aEhBRmArIAS1mRIZtWFf6JxN_7B4meyWK0Y/pub
that in order to use new forms in RC2 we need to disable deprecated forms using below code:
import {disableDeprecatedForms, provideForms} from '@angular/forms';
bootstrap(AppComponent, [
disableDeprecatedForms(),
provideForms()
])
Which apparently means that we now also need to include below in our package.json:
"@angular/forms": "2.0.0-rc.2",
But when I add "@angular/forms": "2.0.0-rc.2", to my package.json and try to restore packages it gives below errors:
npm ERR! node v6.2.1
npm ERR! npm v3.9.3
npm ERR! No compatible version found: @angular/[email protected]
npm ERR! Valid install targets:
npm ERR! 0.1.0
Can anyone please guide?
Upvotes: 4
Views: 3588
Reputation: 10386
Just found that in order to use new forms introduced in Angular 2 RC2, we need to add below package to our packages.json file:
"@angular/forms": "0.1.0"
You may also find below answer useful:
How to migrate Angular 2 RC 1 (or earlier) Forms to Angular 2 RC 2 / RC 4 New Forms
Upvotes: 6