From 92bfac0aada6f7ad34eb2636c17b0dba92eacf28 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Thu, 20 Nov 2014 04:05:22 +0000 Subject: [PATCH] Add angular directive allowing elements to bind to html --- web/skins/bootstrap/js/app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/skins/bootstrap/js/app.js b/web/skins/bootstrap/js/app.js index 2f09cb32f..c6719cf21 100644 --- a/web/skins/bootstrap/js/app.js +++ b/web/skins/bootstrap/js/app.js @@ -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); + } + }); + }; +});