Using font-awesome dynamically, icons don't appear [SOLVED]


#1

Nativescript + Angular + Typescript

If I pass font awesome code dinamically, Nativescript don’t show the icon, some idea about it??

.ts file:

public items = [
{
title : "Calendar",
icon: ""
},
{
title : "Map",
icon: "",
}
....
];

.html file:

<StackLayout orientation="vertical">
    <ListView [items]="items">
        <ng-template let-item="item">
            <Label [text]="item.icon" class="font-awesome"></Label>
        </ng-template>
    </ListView>
</StackLayout>

RESULT:
temp

Trying this code:

<StackLayout orientation="vertical">
    <ListView [items]="sections">
        <ng-template let-item="item">
            <Label text="&#xf0a1;" class="font-awesome"></Label>
        </ng-template>
    </ListView>
</StackLayout>

… the result is correct:
temp-2


#2

SOLUTION.
Array provider should look like this:

public items = [
{
title : "Calendar",
icon: String.fromCharCode(0xf073)
},
{
title : "Map",
icon: String.fromCharCode(0xf041),
}
....
];