From 65607055a5f405e74642cef8cc626c17ddebf5ed Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 23 May 2014 01:34:18 +0200 Subject: add bind unsafe directive --- js/directive/NewsBindUnsafeHtml.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 js/directive/NewsBindUnsafeHtml.js (limited to 'js/directive') 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 + * @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 -- cgit v1.2.3