简体   繁体   English

离子图标和“无法绑定到'名称',因为它不是已知的本机属性”错误

[英]ionic icon and “Can't bind to 'name' since it isn't a known native property” error

I'm using ionic 2 and angular2 for developing mobile app, when i want use ionic icon and [name]'s property with expressions like this : 我要使用ionic 2和angular2来开发移动应用程序时,要使用ionic图标和[name]的属性以及以下表达式:

<icon item-right 
      [name]="result.kind ==='song' ? 'musical-notes' : 'film'">
</icon>

i got an error: 我有一个错误:

angular2-polyfills.js:528 Unhandled Promise rejection: Template parse errors:
Can't bind to 'name' since it isn't a known native property ("

    <icon item-right 
    [ERROR ->][name]="result.kind ==='song' ? 'musical-notes' : 'film'"></icon>

but for my learning source(video tutorial) its work... why ?! 但是对于我的学习资源(视频教程)来说,它的工作...为什么呢?

I would use the ion-icon element instead of the icon one: 我将使用ion-icon元素代替icon

<ion-icon item-right 
  [name]="result.kind ==='song' ? 'musical-notes' : 'film'">
</ion-icon>

See this link for more details: 有关更多详细信息,请参见此链接:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法绑定到“ngForOf”,因为它不是 Ionic / Angular 9 中“ion-item”的已知属性 - Can't bind to 'ngForOf' since it isn't a known property of 'ion-item' in Ionic / Angular 9 Angular 2 RC 5 - 无法绑定到&#39;...&#39;,因为它不是&#39;...&#39;的已知属性 - Angular 2 RC 5 - Can't bind to '…' since it isn't a known property of '…' 无法绑定到 &#39;dtOptions&#39;,因为它不是 &#39;table&#39; 的已知属性。 - Can't bind to 'dtOptions' since it isn't a known property of 'table'. |官方指南坏了吗?| 无法绑定到“ ngFor”,因为它不是已知的本机属性 - |Official guide broken?| Can't bind to 'ngFor' since it isn't a known native property 错误:模板解析错误:无法绑定到“选项”,因为它不是“图表”的已知属性 - Error: Template parse errors: Can't bind to 'options' since it isn't a known property of 'chart' 未捕获的错误:模板解析错误:无法绑定到“columnMode”,因为它不是“ngx-datatable”的已知属性 - Uncaught Error: Template parse errors: Can't bind to 'columnMode' since it isn't a known property of 'ngx-datatable' 在 Angular 中使用 cdkDropListData 时出错,无法绑定到“cdkDropListData”,因为它不是“div”的已知属性 - Error when using cdkDropListData in Angular gives me Can't bind to 'cdkDropListData' since it isn't a known property of 'div' Angular 2 - 无法绑定到&#39;ngModel&#39;,因为它不是&#39;input&#39;的已知属性 - Angular 2 - Can't bind to 'ngModel' since it isn't a known property of 'input' 无法绑定到“ ngModule”,因为它不是“ input”的已知属性。 在angular 2 asp.net核心中 - Can't bind to 'ngModule' since it isn't a known property of 'input'. in angular 2 asp.net core Angular2 RC5教程:无法绑定到'ngModel',因为它不是'input'的已知属性 - Angular2 RC5 tutorial : Can't bind to 'ngModel' since it isn't a known property of 'input'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM