Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 068d861

Browse files
committed
perf(ngBindHtml): watch the original value and sanitize later
1 parent baaa73e commit 068d861

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)