I have been working with Knockout and FontAwesome for a couple of days and I'm trying to display a FontAwesome icon using it's Unicode.
I have a list of items called alerts
which contains different informations about an alert and one icon for it.
if (alerts.Category == 0)
alerts['Category'] = '';
else if (element.Category == 1)
alerts['Category'] = '';
else if (alerts.Category == 2)
alerts['Category'] = '';
else if (alerts.Category == 3)
alerts['Category'] = '';
else if (alerts.Category == 4)
alerts['Category'] = '';
The thing is that when I'm trying to get them into the HTML page like:
<table class="table" id="alertstable">
<tbody data-bind="foreach: alerts">
<tr style: { backgroundColor: Color, color: TextColor }">
<td>
<button type="button" class="btn btn-default"
data-bind="click:$root.GetAlertClick, text:VehicleShortName">
22
</button>
</td>
<td>
<i style="font-family: 'FontAwesome', 'Helvetica'; font-size: 20px;"
data-bind="image:Category"></i>
</td>
</tr>
</tbody>
</table>
It displays all the VehicleShortNames but it doesn't display the icon for each one of them. It is possible to display the icon in the table this way?