For some reason, I am getting Chinese symbols instead of the right icon. I have the .ttf in app/fonts directory and .css under /app. Hope that you will find my mistake
app.css
.fa {
font-size: 60;
font-family: FontAwesome, fontawesome-webfont;
}
.ion {
font-family: Ionicons, ionicons;
font-size: 60;
}
main.ts
import { TNSFontIconService } from 'nativescript-ng2-fonticon';
nativeScriptBootstrap(AppComponent, [
HTTP_PROVIDERS,
provide(TranslateLoader, {
useFactory: () => {
return new TNSTranslateLoader('assets/i18n');
}
}),
TranslateService,
provide(TNSFontIconService, {
useFactory: () => {
return new TNSFontIconService({
'fa': 'font-awesome.css',
'ion': 'ionicons.css'
});
}
})
])
page.html
<Button class="fa" [text]="'fa-bluetooth' | fonticon"></Button>
<Label class="ion" [text]="'ion-flag' | fonticon"></Label>
page.ts
import { TNSFontIconService, TNSFontIconPipe } from 'nativescript-ng2-fonticon';
@Component({
templateUrl: 'pages/pages/page.html',
pipes: [TranslatePipe, TNSFontIconPipe]
})
export class Pages {
constructor(private fonticon: TNSFontIconService,
private translate: TranslateService) {}