From 068d8615d245a70bfde9007606b08a54c6e1cfec Mon Sep 17 00:00:00 2001 From: Chirayu Krishnappa Date: Thu, 29 Aug 2013 12:47:51 -0700 Subject: perf(ngBindHtml): watch the original value and sanitize later --- src/ng/directive/ngBind.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ng/directive/ngBind.js') diff --git a/src/ng/directive/ngBind.js b/src/ng/directive/ngBind.js index 9e642ac2..13394f20 100644 --- a/src/ng/directive/ngBind.js +++ b/src/ng/directive/ngBind.js @@ -136,8 +136,8 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) { var ngBindHtmlDirective = ['$sce', function($sce) { return function(scope, element, attr) { element.addClass('ng-binding').data('$binding', attr.ngBindHtml); - scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function ngBindHtmlWatchAction(value) { - element.html(value || ''); + scope.$watch(attr.ngBindHtml, function ngBindHtmlWatchAction(value) { + element.html($sce.getTrustedHtml(value) || ''); }); }; }]; -- cgit v1.2.3