Error: Entity not found:  


#1

Hi,

I have this snippet of code which keeps giving this error.

<Button text="&#xf090;&nbsp;&nbsp;Save Account" tap="{{ ...}}" class="btn btn-primary font-awesome" isEnabled="{{ ... }}"/>

The html non-breaking space &nbsp; gives the syntax error. The app works well and the space is properly rendered, but I just don’t like seeing errors. :slight_smile:

Specs:
1. tns --version: 2.5.0
2. tns-modules: 2.5.0
3. tns-android: 2.5.0
4. OS: Windows 10.
5. IDE: WebStorm 2016.3.3
6. Node: 7.3.0
7. npm: 4.1.1
8. build command: tns run android

Kind regards.


#2

I guess I would say that it would be better if you could find a way in CSS to space out the icon from the text, rather than using &nbsp;


#3

How is that possible? I have tried without &nbsp; and it didn’t work. Do you know how else it can be done?


#4

Now I appreciate how sharing your problem most times leads you to finding the solution. :slight_smile:

I replaced all occurrences of &nbsp; with &#xa0; and problem solved.

Thanks for the pointer.


#5

that’s actually a great little tip, maybe you could add it to the Tips section with a code snippet? :slight_smile:


#6

where is this tips section?

also anyone wondering how to set font icons via js its String.fromCharCode(0xf2d6)


#7

@roblav96 Tips are here: http://forum.nativescript.org/c/tips

Also, I’m not sure about setting icons via the char code, maybe you’d need to create a plugin. Nathan notes that you can directly use unicode like this <Label class="fa" text="\uf293"></Label> but it’s hard to maintain, so he created the fonticon plugin http://plugins.nativescript.org/plugin/nativescript-ngx-fonticon