Skip to content

Using font-awesome dynamically, icons don't appear #1060

@ParVisual

Description

@ParVisual

When I pass font-awesome unicode dinamically, Nativescript don’t show the icon.

my-section.component.ts file:

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

my-section.component.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>

WRONG RESULT:
temp

If I try hardcoding the unicode value:

<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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions