I have an array of errors to display in a
<div *ngFor="let error of arrayOfErrors">
{{error.errMsg}}
</div>
and in AngularJs it was possible to do something in a loop to custom the errMsg like :
error.errMsg = 'my error has this code <b><a href="/#/my-link/{0}">{0}/a></b>.'.format(error.errCode);
But now, with Angular8, I didn't found any way to simply do this html formatting and interpolation... I tried something like :
error.errMsg = `my error has this code <b><a href="/#/my-link/${error.errCode}">${error.errCode}/a></b>.`;
but the html tag aren't interpreted and are displayed like gross string !
I read a lot of topic about Dynamic Component with Angular2+ but it seems to be a bit overkill for my needs ...
Is there a way to simply reach my goal ?
Thanks for your help !
Try using innerHTML
<div *ngFor="let error of arrayOfErrors">
<span [innerHTML]="error.errMsg"></span>
</div>