Skip to content

Commit

Permalink
fix(uiView): Made anim work with angular 1.3
Browse files Browse the repository at this point in the history
$animate changed to promise-based in angular 1.3. Added an adapter which
passes the callback to $animate, but if a promise is returned, uses the
promise. Prior PR was #1345

Closes #1367
Closes #1345
  • Loading branch information
christopherthielen committed Sep 13, 2014
1 parent 210ba61 commit c3bb7ad
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/viewDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,14 @@ function $ViewDirective( $state, $injector, $uiViewScroll) {

if ($animate) {
return {
enter: function(element, target, cb) { $animate.enter(element, null, target, cb); },
leave: function(element, cb) { $animate.leave(element, cb); }
enter: function(element, target, cb) {
var promise = $animate.enter(element, null, target, cb);
if (promise && promise.then) promise.then(cb);
},
leave: function(element, cb) {
var promise = $animate.leave(element, cb);
if (promise && promise.then) promise.then(cb);
}
};
}

Expand Down

0 comments on commit c3bb7ad

Please sign in to comment.