I used to be able to use ng-bind-html-unsafe to output unsanitized code (because sanitization happens serverside).
But now that option is gone? I know I
I would strongly recommend checking out this SIMPLE JSFiddle example. Was a lifesaver:
http://jsfiddle.net/cC5VZ/2/
var app = angular.module('app', []);
app.controller('testApp', function( $scope ) {
$scope.testHTML = ' Welcome :)
';
});
app.directive('bindHtmlUnsafe', function( $parse, $compile ) {
return function( $scope, $element, $attrs ) {
var compile = function( newHTML ) {
newHTML = $compile(newHTML)($scope);
$element.html('').append(newHTML);
};
var htmlName = $attrs.bindHtmlUnsafe;
$scope.$watch(htmlName, function( newHTML ) {
if(!newHTML) return;
compile(newHTML);
});
};
});