Create directive to $compile
your html.
angular.module("app").directive('compilehtml', ["$compile", "$parse", function($compile, $parse) {
return {
restrict: 'A',
link: function($scope, element, attr) {
var parse = $parse(attr.ngBindHtml);
function value() { return (parse($scope) || '').toString(); }
$scope.$watch(value, function() {
$compile(element, null, -9999)($scope);
});
}
}
}]);
Then add this directive
<div ng-bind-html="form" compilehtml></div>
DEMO
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…