Reputation: 253
im trying to show some symbols in angular2 template. This works fine:
<div></div>
This works, too:
<div>{{""}}</div> //colon elided
But this doesn't:
<div>{{getSymbol()}}</div>
whith
private symbol(): string {
//return this.access.accessLevel >= AccessLevel.expert ? "\e911" : "\e917";
return this.access.accessLevel >= AccessLevel.expert ? "" : "";
}
Upvotes: 3
Views: 3458
Reputation: 71891
With string interpolation, {{}}
is treated as a text string. You should use innerHtml
binding to get actual html in your element:
<div [innerHtml]="getSymbol()"></div>
Upvotes: 10