mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-29 05:15:38 +08:00
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:
committed by
Igor Minar
parent
f3de5b6eac
commit
3410f65e79
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user