加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

角度 – 离子2和ng-模型

发布时间:2020-12-17 10:19:42 所属栏目:安全 来源:网络整理
导读:我真的觉得它是一个早期采用者,因为谷歌无法找到解决我的问题的方法:) 我以某种方式得到这个错误: Can’t bind to ‘ng-model’ since it isn’t a known native property 我没有在Ionic中看到@Component,所以页面配置如下: import {Page,NavController} f
我真的觉得它是一个早期采用者,因为谷歌无法找到解决我的问题的方法:)

我以某种方式得到这个错误:

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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读