Skip to content

Commit c86d23a

Browse files
chirayukjamesdaily
authored andcommitted
perf(ngBindHtml): watch the original value and sanitize later
1 parent 03fbbf3 commit c86d23a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ng/directive/ngBind.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) {
136136
var ngBindHtmlDirective = ['$sce', function($sce) {
137137
return function(scope, element, attr) {
138138
element.addClass('ng-binding').data('$binding', attr.ngBindHtml);
139-
scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function ngBindHtmlWatchAction(value) {
140-
element.html(value || '');
139+
scope.$watch(attr.ngBindHtml, function ngBindHtmlWatchAction(value) {
140+
element.html($sce.getTrustedHtml(value) || '');
141141
});
142142
};
143143
}];

0 commit comments

Comments
 (0)