user3255061 user3255061 - 2 months ago 17
AngularJS Question

AngularUI Bootstrap: Parse HTML in carousel text

I'm trying to implement an Angular UI Bootstrap Carousel and have HTML in the texts. Thought I could use something like

text: $sce.trustAsHtml('Nice image <br />test')


but apparently that doesn't work and I've no clue why.

Plunkr: https://plnkr.co/edit/9PvaS8SoRmN1o52wiAf8?p=preview (fork of the offical example from the docs).

Answer

Use ng-bind-html directive to display html content on view

<p ng-bind-html="slide.text"></p>

Demo Plunkr