, ng-bind-html , UI Bootstrap - , , .
HTML , ng-include.
:
<div ng-include="'path/to/html'"></div>
, , : $scope.path = "path/to/html";:
<div ng-include="path"></div>
, HTML / Angular ( , , , - ), $compile, :
app.directive("ngBindHtmlCompile", function($compile, $sce){
return {
restrict: "A",
link: function(scope, element, attrs){
scope.$watch($sce.parseAsHtml(attrs.ngBindHtmlCompile), function(html){
var el = angular.element("<div>").html(html);
element.empty();
element.append(el.children());
$compile(element.contents())(scope);
})
}
};
});
"ngSanitize" . :
<div ng-bind-html-compile="html"></div>