I am including html-content that contains angular-font-awesome <fa>
tags into my .html file by using <div [innerHtml]="fa-containing-content">
.
My problem is that the fa tags do not get converted into i tags, so no icon is shown. I suspect that the code that converts fa into the actual icon is not run after the inclusion, but I don't know how to address it.
To be clear, angular-font-awesome works fine for me otherwise. The problem only appears when I have the fa tags inside the content that is included via innerHtml.
ATTEMPT 1:
test: string ="<fa name='heart'></fa>";
<div class="test" [innerHtml]="test"></div>
OUTPUT:
<div _ngcontent-c1="" class="test"></div>
ATTEMPT 2: Using safeHtml pipe
test: string ="<fa name='heart'></fa>";
<div class="test" [innerHtml]="test | safeHtml"></div>
OUTPUT:
<div _ngcontent-c1="" class="test"><fa name="heart"></fa></div>
The problem remains that the <fa>
tag is not converted, i.e. the <i>
is not being inserted by angular-font-awesome.
How can I get angular-font-awesome to run over this again after the innerHtml has been included?