[4.6] No longer possible to bind value to ion-icon's name attribute
See original GitHub issueBug Report
Ionic version:
[x] 4.x
Current behavior:
In 4.5 I could change the ion-icon
based on a property set in the component. It is no longer working in 4.6 (4.6.1-dev.201907022006.a656dad)
<ion-button (click)="isPlaying ? onPause() : onPlay()" fill="clear" class="base-btn solid-btn">
<ion-icon slot="icon-only" [name]="isPlaying ? 'pause' : 'play'"></ion-icon>
</ion-button>
Expected behavior:
Steps to reproduce:
This minimal code example doesn’t show an icon:
<ion-icon [name]="'pause'"></ion-icon>
Source looks like it’s missing the svg
element.
Other information:
Ionic info:
Ionic:
Ionic CLI : 5.2.1 (/Users/kim/.npm-global/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.6.1-dev.201907022006.a656dad
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1
Cordova:
Cordova CLI : 9.0.0
Cordova Platforms : android 8.0.0, ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 8 other plugins)
Utility:
cordova-res : 0.5.1
native-run : 0.2.7
System:
Android SDK Tools : 26.1.1 (/Users/kim/Library/Android/sdk)
ios-deploy : 1.9.4
ios-sim : 8.0.1
NodeJS : v10.15.0 (/usr/local/bin/node)
npm : 6.9.2
OS : macOS Mojave
Xcode : Xcode 10.2.1 Build version 10E1001
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
[4.6] No longer possible to bind value to ion-icon's name ...
Bug Report Ionic version: [x] 4.x Current behavior: In 4.5 I could change the ion-icon based on a property set in the component....
Read more >Ionicons Usage Guide
When using icons in Ionic Framework you can specify different icons per platform. Use the md and ios attributes and provide the platform...
Read more >ionic icon and "Can't bind to 'name' since it isn't a known ...
I would use the ion-icon element instead of the icon one: <ion-icon item-right [name]="result.kind ==='song' ?
Read more >ionic/docs/core.json - UNPKG
"text": "id The id of the action sheet to dismiss. If an id is not provided, it will dismiss the most recently opened...
Read more >Latest topics - Ionic Forum
Previous Ionic-angular@3.9 + Capacitor@4 possible? ... so it doesn't feel right that the default name attribute is not binding the icon ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s working in 4.6.0 but not in 4.6.1-dev, and I was missing a
Modal
to trigger the behavior.You can check out the code here: https://github.com/biesbjerg/ion-icon-bug
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.