From 37e464e991cc80674226b488ed80d21127e0587d Mon Sep 17 00:00:00 2001 From: Michiel De Mey Date: Thu, 24 Jul 2014 16:29:41 -0700 Subject: [PATCH] Added AnimationEnd event This event will trigger when the animation on the ui-view is done animating. Fixed an issue when currentScope was undefined --- src/viewDirective.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/viewDirective.js b/src/viewDirective.js index 3610025f6..0a4dce845 100644 --- a/src/viewDirective.js +++ b/src/viewDirective.js @@ -210,6 +210,10 @@ function $ViewDirective( $state, $injector, $uiViewScroll) { var clone = $transclude(newScope, function(clone) { renderer.enter(clone, $element, function onUiViewEnter() { + if(currentScope) { + currentScope.$emit('$viewContentAnimationEnded'); + } + if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) { $uiViewScroll(clone); }