Hi All,

I am trying to echo an Unicode character in an HTML element attribute so I 
can draw an icon using CSS and the :after pseudo element.

However, AngularJS prints the unicode just fine, but somehow it is not 
recognized as such. Instead the browser just displays the complete Unicode 
(e.g. ) and not the icon.
Any clue on how this can be solved?


Code in AngularJS template that does show an icon:

<a href="{{ menuItems.planning.url }}" data-button data-icon="*&#xE001;*">{{ 
menuItems.planning.title }}</a>


*Result:*

<https://lh6.googleusercontent.com/-NyKbRbzh2zE/VRFcrXKLUcI/AAAAAAAAATI/T1UD6zkwEm8/s1600/Screen%2BShot%2B2015-03-24%2Bat%2B13.46.08%2Bpm.png>


Code in AngularJS template that does *NOT* show an icon:

<a href="{{ menuItems.planning.url }}" data-button data-icon="*{{ 
menuItems.planning.icon }}*">{{ menuItems.planning.title }}</a>


*Result:*

<https://lh6.googleusercontent.com/-if6y9gICCQk/VRFdFXinHEI/AAAAAAAAATY/7DBT9puwuAE/s1600/Screen%2BShot%2B2015-03-24%2Bat%2B13.47.59%2Bpm.png>




CSS (Less) code:

&[data-icon]:after {
content:attr(data-icon);
font-family:iconfont;
margin-left:1rem;
}


Any help would be greatly appreciated.

Cheers,
Allard

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to