Adding text and a fonticon inside a button


#1

If you have been looking how to add text and an icon inside your button. Look no further!

Download the following plugin npm install nativescript-ngx-fonticon --save

Follow the installation instructions on : https://github.com/NathanWalker/nativescript-ngx-fonticon

Adding text and a fonticon is as simple as :

<Button text="{{'fa-facebook' | fonticon}} Sign in Facebook" class="fa btn btn-primary" (tap)="loginFacebook()"></Button>


#2

Similarly, if you are using Angular date/time pipes, you can create a combination button text like this:

<Label class="small" text="{{yowl.date | date:'ss'}} secs" fontSize="15"></Label>

And the result is: