Font-Awesome + MySQL. Icon not display correctly



I have some icon values stored in a MySQL db, as VARCHAR.

I’m trying to get this values and show them in my app as real icons.

I get all stuff using php, and converting the result to json.

For instance, I get this string from mysql:

valueFromJson = "0xf073"

, and I apply it:

<Label [text]="valueFromJson" class="font-awesome"></Label>

the result is:


instead of the icon symbol…

Any idea to solve it?



You need a semicolon at the end of it, also it would look
something like &#xf073;

and if that doesn’t work, you can try storing the Unicode value of it,

so, 0xf073 is fa-calendar, the Unicode of it is, \uf073

refer for the unicode value
and for getting the hex value.



Thanks @multishiv19 !!

The way that works for me is using unicode: \uf073


In my experience, I’ve noticed that when you want to use font awesome via data binding, then only unicode way works,
and when you want to use it directly in the xml, then the hex code way works.