From 8aaa53ac7545f46403791846c0c3f1f2d395e848 Mon Sep 17 00:00:00 2001 From: Michiel De Mey Date: Thu, 24 Jul 2014 16:29:41 -0700 Subject: [PATCH] feat($ViewDirective) add $viewContentAnimationEnded trigger This event will trigger when the animation on the ui-view is done animating. --- 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); }