Skip to content

Commit c3bb7ad

Browse files
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
1 parent 210ba61 commit c3bb7ad

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/viewDirective.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,14 @@ function $ViewDirective( $state, $injector, $uiViewScroll) {
142142

143143
if ($animate) {
144144
return {
145-
enter: function(element, target, cb) { $animate.enter(element, null, target, cb); },
146-
leave: function(element, cb) { $animate.leave(element, cb); }
145+
enter: function(element, target, cb) {
146+
var promise = $animate.enter(element, null, target, cb);
147+
if (promise && promise.then) promise.then(cb);
148+
},
149+
leave: function(element, cb) {
150+
var promise = $animate.leave(element, cb);
151+
if (promise && promise.then) promise.then(cb);
152+
}
147153
};
148154
}
149155

0 commit comments

Comments
 (0)