Reputation: 158
I want to display fontawesome icons in my selectbox.
For static purposes I succeeded with the following code:
ng-options=" '' +l.Name for l in locations"
My only problem is that I need to dynamicly show the icon according to the type of my location. When I fix this in my controller and make name as following:
if(logic){
$scope.locations[0].name = "" + $scope.locations[0].name;
}
This shows the unicode as plain text. What am i doing wrong or am I missing something?
Thanks alot!
Upvotes: 1
Views: 1068
Reputation: 46
You need to use the unicode literal in javascript:
$scope.locations[0].name = "\uf0e7"
that's the unicode literal notation.
Upvotes: 3