mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-29 13:25:40 +08:00
fix($animate): ensure all comment nodes are removed during a leave animation
Closes #6403
This commit is contained in:
@@ -3418,6 +3418,27 @@ describe("ngAnimate", function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should remove all element and comment nodes during leave animation',
|
||||
inject(function($compile, $rootScope) {
|
||||
|
||||
$rootScope.items = [1,2,3,4,5];
|
||||
|
||||
var element = html($compile(
|
||||
'<div>' +
|
||||
' <div class="animated" ng-repeat-start="item in items">start</div>' +
|
||||
' <div ng-repeat-end>end</div>' +
|
||||
'</div>'
|
||||
)($rootScope));
|
||||
|
||||
$rootScope.$digest();
|
||||
|
||||
$rootScope.items = [];
|
||||
|
||||
$rootScope.$digest();
|
||||
|
||||
expect(element.children().length).toBe(0);
|
||||
}));
|
||||
|
||||
it('should not throw an error when only comment nodes are rendered in the animation',
|
||||
inject(function($rootScope, $compile) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user