Reputation: 1823
I've just done an update to RC4; however, many things stopped working, the below was working fine. Now, ngModel does not work inside unless you remove one of them.
page.js
import {Component} from '@angular/core';
page.html
<form (ngSubmit)="submitForm()">
<ion-list radio-group [(ngModel)]="content" name="ionListGroup">
</ion-list>
</form>
When I click to open page.html, nothing happens, but I see:
*It looks like you're using the old forms module. This will be opt-in in the next RC, and
will eventually be removed in favor of the new forms module. For more information, see:
https://docs.google.com/document/u/1/d/1RIezQqE4aEhBRmArIAS1mRIZtWFf6JxN_7B4meyWK0Y/pub
I've done some debugging and I've seen that if I remove [(ngModel)]="content"
or <form>
tag everything work fine again, but I can't remove any of them because I need them both.
Upvotes: 4
Views: 1759
Reputation: 259
import { FormsModule } from '@angular/forms';
@MgModule({
imports: [
...
FormsModule,
...
])}
<input mdInput type="text" [(ngModel)]="username" placeholder="User Name" name="first" required>
Upvotes: 3
Reputation: 687
From the docs mentioned in the error message. You need the following step
import {disableDeprecatedForms, provideForms} from '@angular/forms';
bootstrap(AppComponent, [
disableDeprecatedForms()
provideForms()
])
Upvotes: 0