perf(ngBind): bypass jquery/jqlite when setting text

This commit is contained in:
Igor Minar
2014-08-11 18:05:45 -07:00
parent d208ba2544
commit 0a738ce176

View File

@@ -57,11 +57,13 @@ var ngBindDirective = ngDirective({
return function ngBindLink(scope, element, attr) {
element.data('$binding', 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);
});
};
}