mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-16 12:22:26 +01:00
26 lines
486 B
JavaScript
26 lines
486 B
JavaScript
(function () {
|
|
'use strict';
|
|
|
|
angular.module('core')
|
|
.directive('dynamicHtml', dynamicHtml);
|
|
|
|
dynamicHtml.$inject = ['$compile'];
|
|
|
|
function dynamicHtml($compile) {
|
|
var directive = {
|
|
restrict: 'A',
|
|
replace: true,
|
|
link: link
|
|
};
|
|
|
|
return directive;
|
|
|
|
function link(scope, element, attrs) {
|
|
scope.$watch(attrs.dynamicHtml, function (html) {
|
|
element.html(html);
|
|
$compile(element.contents())(scope);
|
|
});
|
|
}
|
|
}
|
|
}());
|