Your issue is with angular sanitization. It will not let you use ng-bind-html
until you stick your HTML content in a special variable that is marked as trusted HTML. Angular makes you do this so that you know that you are very explicitly telling Angular it's okay to render this markup.
It helps protect the average developer from accidentally rendering user input unencoded, which would be very dangerous. You wouldn't want users submitting javascript in input fields and then having your app render that script right into the page somewhere. If it did, the malicious script would run when rendered and could cause all sorts of havoc.
You need to include the ngSanitize module in your app's dependencies.
var app = angular.module('myApp', ['ngSanitize']);
Don't forget to include the angular-sanitize lib in your script references.
<script src="//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-sanitize.js"></script>
Then you need to mark your HTML content as safe to render using the $sce
service.
app.controller('myController', function ($scope, $sce) {
$scope.trustedHtml = $sce.trustAsHtml(contentHTML);
});
Only then will ng-bind-html
work.
<div ng-bind-html="trustedHtml"></div>
Demo: http://codepen.io/Chevex/pen/xGYydr?editors=101