Colin G
Colin G

Reputation: 417

How to enable html in AngularUI accordion-group content?

I am trying to display content in an accordion-group that potentially has html markup. The content is being retrieved from external sources. How do I do this?

You can see this at Plnkr (content hard-coded for test purposes)

As you can see, the items show with markup not converted to links. How do I enable html markup?

Any suggestions will be appreciated.

Upvotes: 0

Views: 109

Answers (1)

shaunhusain
shaunhusain

Reputation: 19748

Found you're running into something new with 1.2. There's some extra security/sanitization business wrapped in this $sce service. It's news to me but here's the updated working plunkr

http://plnkr.co/edit/frmJgjmwFq1hg4haZxJR?p=preview

The key here was to inject $sce then us it like

$sce.trustAsHtml

On the strings to be trusted, then using ng-bind-html to get it to pass through the HTML without turning it into a string.

Upvotes: 1

Related Questions