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
This commit is contained in:
Michał Gołębiowski
2013-10-16 15:15:21 +02:00
committed by Igor Minar
parent f3de5b6eac
commit 3410f65e79
17 changed files with 64 additions and 30 deletions

View File

@@ -301,7 +301,7 @@ describe("ngAnimate", function() {
inject(function($animate, $compile, $rootScope, $timeout, $sniffer) {
$rootScope.$digest();
element.html('');
element.empty();
var child1 = $compile('<div>1</div>')($rootScope);
var child2 = $compile('<div>2</div>')($rootScope);