ionic-material-icons icon indicating copy to clipboard operation
ionic-material-icons copied to clipboard

Can't use with interpolated / bind / variable or values

Open matheusdavidson opened this issue 8 years ago • 2 comments

Hi, i can use this with a fixed value like <ion-icon md-name="settings"></ion-icon>, but it won't work with interpolated/bind values like <ion-icon [md-name]="variable"></ion-icon> or <ion-icon md-name="{{variable}}"></ion-icon>.

matheusdavidson avatar Apr 27 '17 16:04 matheusdavidson

The problem is your css or font is tied to the attribute md-name, but when you interpolate or bind, the attribute seems to be removed form the html. A quick workaround is to add an extra empty md-name when interpolating: <ion-icon md-name [md-name]="'settings'"></ion-icon>

matheusdavidson avatar Apr 27 '17 16:04 matheusdavidson

Thanks for pointing this out. I will look into it. Maybe it can become something like this:

<!-- fixed value -->
<ion-icon md name="settings"></ion-icon>
<!-- with variable -->
<ion-icon md [name]="someVariable"></ion-icon>

ihadeed avatar Apr 27 '17 20:04 ihadeed