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

Commit

Permalink
perf(ngBindHtml): watch the original value and sanitize later
Browse files Browse the repository at this point in the history
  • Loading branch information
chirayuk committed Aug 29, 2013
1 parent baaa73e commit 068d861
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ng/directive/ngBind.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) || '');
});
};
}];

0 comments on commit 068d861

Please sign in to comment.