我真的觉得它是一个早期采用者,因为谷歌无法找到解决我的问题的方法:)
我以某种方式得到这个错误:
Can’t bind to ‘ng-model’ since it isn’t a known native property
我没有在Ionic中看到@Component,所以页面配置如下:
- import {Page,NavController} from 'ionic-framework/ionic';
- @Page({
- templateUrl: 'app/home/home.html',directives: [Select]
- })
我的模板是这样的:
- <ion-input floating-label>
- <ion-label>Search text...</ion-label>
- <input type="text" [(ng-model)]="searchInput" />
- </ion-input>
我正在使用Ionic 2.
干杯
在Angular 2中,您应该在模板中使用
ngModel
,而不是ng-model.