user3255061 user3255061 - 1 year ago 123
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: (fork of the offical example from the docs).

Answer Source

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

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

Demo Plunkr

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download