diff options
| author | Chirayu Krishnappa | 2013-08-29 12:47:51 -0700 | 
|---|---|---|
| committer | Chirayu Krishnappa | 2013-08-29 12:47:51 -0700 | 
| commit | 068d8615d245a70bfde9007606b08a54c6e1cfec (patch) | |
| tree | f8009aa8dd8d00ab5b6cddb20861999ef79260e3 /src/ng/directive/ngBind.js | |
| parent | baaa73ee1ef25fa506ff7aaab3159d710acdafdb (diff) | |
| download | angular.js-068d8615d245a70bfde9007606b08a54c6e1cfec.tar.bz2 | |
perf(ngBindHtml): watch the original value and sanitize later
Diffstat (limited to 'src/ng/directive/ngBind.js')
| -rw-r--r-- | src/ng/directive/ngBind.js | 4 | 
1 files changed, 2 insertions, 2 deletions
| 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) || '');      });    };  }]; | 
