Ion 2 and ng models

I really feel like an early adopter because Google could not find a way to fix my problem :)

I somehow get this error:

Cannot bind to 'ng-model' since this is not a known native property

I don't see @Component in Ionic, so the page is configured as follows:

import {Page, NavController} from 'ionic-framework/ionic'; @Page({ templateUrl: 'app/home/home.html', directives: [Select] }) 

and my template is this:

 <ion-input floating-label> <ion-label>Search text...</ion-label> <input type="text" [(ng-model)]="searchInput" /> </ion-input> 

I am using Ionic 2.

Greetings

+6
source share
1 answer

In Angular 2, you should use ngModel in the template, not ng-model .

+9
source

All Articles