aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngAnimate
diff options
context:
space:
mode:
authorMichał Gołębiowski2013-10-16 15:15:21 +0200
committerIgor Minar2013-12-13 02:07:11 -0800
commit3410f65e790a81d457b4f4601a1e760a6f8ede5e (patch)
tree2f37146f1399d23ea02de44e8209879eda949e1f /src/ngAnimate
parentf3de5b6eac90baf649506072162f36dbc6d2f028 (diff)
downloadangular.js-3410f65e790a81d457b4f4601a1e760a6f8ede5e.tar.bz2
perf(jqLite): implement and use the `empty` method in place of `html(‘’)`
jQuery's elem.html('') is way slower than elem.empty(). As clearing element contents happens quite often in certain scenarios, switching to using .empty() provides a significant performance boost when using Angular with jQuery. Closes #4457
Diffstat (limited to 'src/ngAnimate')
-rw-r--r--src/ngAnimate/animate.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js
index 8ff7b429..aeb6e32e 100644
--- a/src/ngAnimate/animate.js
+++ b/src/ngAnimate/animate.js
@@ -1237,7 +1237,7 @@ angular.module('ngAnimate', ['ng'])
//make the element super hidden and override any CSS style values
clone.attr('style','position:absolute; top:-9999px; left:-9999px');
clone.removeAttr('id');
- clone.html('');
+ clone.empty();
forEach(oldClasses.split(' '), function(klass) {
clone.removeClass(klass);