diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-23 01:34:18 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-23 01:34:18 +0200 |
commit | 65607055a5f405e74642cef8cc626c17ddebf5ed (patch) | |
tree | 47892d849e34cfda0c2470dd534460164ae8ff71 /js | |
parent | 6ceb0582359e7ea13ad7dc2b34776b929a57753e (diff) |
add bind unsafe directive
Diffstat (limited to 'js')
-rw-r--r-- | js/build/app.js | 8 | ||||
-rw-r--r-- | js/directive/NewsBindUnsafeHtml.js | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/js/build/app.js b/js/build/app.js index 1743a20a7..b4bd09d3b 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -986,6 +986,14 @@ var $__build_47_app__ = function () { writable: true }), $__2; }; + app.directive('newsBindHtmlUnsafe', function () { + 'use strict'; + return function (scope, elem, attr) { + scope.$watch(attr.newsBindHtmlUnsafe, function () { + elem.html(scope.$eval(attr.newsBindHtmlUnsafe)); + }); + }; + }); app.directive('newsReadFile', function () { 'use strict'; return function (scope, elem, attr) { diff --git a/js/directive/NewsBindUnsafeHtml.js b/js/directive/NewsBindUnsafeHtml.js new file mode 100644 index 000000000..7c839d156 --- /dev/null +++ b/js/directive/NewsBindUnsafeHtml.js @@ -0,0 +1,18 @@ +/** + * ownCloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Bernhard Posselt <dev@bernhard-posselt.com> + * @copyright Bernhard Posselt 2014 + */ +app.directive('newsBindHtmlUnsafe', () => { + 'use strict'; + + return (scope, elem, attr) => { + scope.$watch(attr.newsBindHtmlUnsafe, () => { + elem.html(scope.$eval(attr.newsBindHtmlUnsafe)); + }); + }; +});
\ No newline at end of file |