mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 19:40:56 +08:00
fix(ngSwitch): ensure correct iterator is passed to async function
Closes #8833
This commit is contained in:
committed by
Peter Bacon Darwin
parent
6d1e7cdc51
commit
712299c2a2
@@ -154,11 +154,12 @@ var ngSwitchDirective = ['$animate', function($animate) {
|
||||
for (i = 0, ii = selectedScopes.length; i < ii; ++i) {
|
||||
var selected = getBlockNodes(selectedElements[i].clone);
|
||||
selectedScopes[i].$destroy();
|
||||
|
||||
var promise = previousLeaveAnimations[i] = $animate.leave(selected);
|
||||
promise.then(function() {
|
||||
previousLeaveAnimations.splice(i, 1);
|
||||
});
|
||||
promise.then((function(i) {
|
||||
return function(){
|
||||
previousLeaveAnimations.splice(i, 1);
|
||||
};
|
||||
}(i)));
|
||||
}
|
||||
|
||||
selectedElements.length = 0;
|
||||
|
||||
Reference in New Issue
Block a user