From 3410f65e790a81d457b4f4601a1e760a6f8ede5e Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski Date: Wed, 16 Oct 2013 15:15:21 +0200 Subject: 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 --- test/helpers/testabilityPatch.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/helpers/testabilityPatch.js') diff --git a/test/helpers/testabilityPatch.js b/test/helpers/testabilityPatch.js index 41b5042a..f61be4ee 100644 --- a/test/helpers/testabilityPatch.js +++ b/test/helpers/testabilityPatch.js @@ -29,8 +29,7 @@ beforeEach(function() { bindJQuery(); } - - angular.element(document.body).html('').removeData(); + angular.element(document.body).empty().removeData(); }); afterEach(function() { -- cgit v1.2.3