mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
perf(ngBindHtml): watch the original value and sanitize later
This commit is contained in:
parent
baaa73ee1e
commit
068d8615d2
1 changed files with 2 additions and 2 deletions
|
|
@ -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) || '');
|
||||
});
|
||||
};
|
||||
}];
|
||||
|
|
|
|||
Loading…
Reference in a new issue