Sanitizing content


Hey guys,

I noticed ngSanitize was removed from the Ionic-Angular bundle. I was using that to display HTML content in my view. Specifically I was using ng-bind-html like so:

<div class='talk_description contentpadding long_text' ng-bind-html="'{{talk_item.content.description}}'"></div>

That now no longer works. Is there an alternative I can use?


You can use Angular’s ngSanitize, you’ll just have to include it yourself:

For instance, if you Bower-install packages to a “lib” directory, you’d just bower install angular-sanitize and then include this in your index.html (or wherever you import scripts):

<script src="lib/angular-sanitize/angular-sanitize.min.js"></script>


Thanks @jough added a version of ngSanitize manually and it works.