I have to render a string (item.tabs.review.content), that is parsed into HTML using $sce.trustAsHtml.
The main issue I am having is that within the string are references to an array in the item object (item.tabs.review.images).
.material(ng-bind-html='item.tabs.review.content')
The issue that I am having is that once the HTML is rendered in the browser, the double curly braces are being ignored and are not being populated by the object?
<h1>TEsting</h1>
<img ng-src='data{{item.tabs.review.images[0].filetype}};base64{{item.tabs.review.images[0].base64}}'>
Added a plunker. http://plnkr.co/edit/Jkrx3SxNjWmHPQnKbnFY?p=preview
I'd suggest create directive that will play with the value first by using
$parse,$parsewith ascopewill give the value of that scope variable provided in directive attribute. And then unescape thehtmlto replace the htmlentity's to the html tags, for that you should useunescapeHTMLfunction which I added an answer. Afterwards use$interpolateto get value of{{}}interpolated content will give yoursrc.$sce.parseHtmlto sanitize the html content.Markup
Directive
Demo Plunkr