Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 2 and ng-model

I truly feel as an early adopter because Google couldn't find a way to fix my issue :)

I'm somehow getting this error:

Can't bind to 'ng-model' since it isn't a known native property

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

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'm using Ionic 2.

Cheers

like image 601
atardadi Avatar asked Dec 27 '15 06:12

atardadi


1 Answers

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

like image 196
Yaron Schwimmer Avatar answered Oct 15 '22 05:10

Yaron Schwimmer