diff --git a/src/ng/directive/ngBind.js b/src/ng/directive/ngBind.js index 5dbb0a66e87a..aa4d8fa04410 100644 --- a/src/ng/directive/ngBind.js +++ b/src/ng/directive/ngBind.js @@ -58,11 +58,9 @@ var ngBindDirective = ['$compile', function($compile) { $compile.$$addBindingClass(templateElement); return function ngBindLink(scope, element, attr) { $compile.$$addBindingInfo(element, attr.ngBind); + element = element[0]; scope.$watch(attr.ngBind, function ngBindWatchAction(value) { - // We are purposefully using == here rather than === because we want to - // catch when value is "null or undefined" - // jshint -W041 - element.text(value == undefined ? '' : value); + element.textContent = value === undefined ? '' : value; }); }; } @@ -128,8 +126,9 @@ var ngBindTemplateDirective = ['$interpolate', '$compile', function($interpolate return function ngBindTemplateLink(scope, element, attr) { var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate)); $compile.$$addBindingInfo(element, interpolateFn.expressions); + element = element[0]; attr.$observe('ngBindTemplate', function(value) { - element.text(value); + element.textContent = value === undefined ? '' : value; }); }; }