Add angular directive allowing elements to bind to html
This commit is contained in:
parent
408c6111b8
commit
92bfac0aad
|
@ -33,3 +33,13 @@ ZoneMinder.factory('Console', function($http) {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ZoneMinder.directive('angularHtmlBind', function($compile) {
|
||||||
|
return function(scope, elm, attrs) {
|
||||||
|
scope.$watch(attrs.angularHtmlBind, function(newValue, oldValue) {
|
||||||
|
if (newValue && newValue !== oldValue) {
|
||||||
|
elm.html(newValue);
|
||||||
|
$compile(elm.contents())(scope);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue