From c3bb7ad903da1e1f3c91019cfd255be8489ff4ef Mon Sep 17 00:00:00 2001 From: christopherthielen Date: Sat, 13 Sep 2014 15:53:32 -0500 Subject: [PATCH] fix(uiView): Made anim work with angular 1.3 $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 --- src/viewDirective.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/viewDirective.js b/src/viewDirective.js index 7f9632d80..b937aea3c 100644 --- a/src/viewDirective.js +++ b/src/viewDirective.js @@ -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); + } }; }