Skip to content

Commit

Permalink
Added AnimationEnd event
Browse files Browse the repository at this point in the history
This event will trigger when the animation on the ui-view is done animating.

Fixed an issue when currentScope was undefined
  • Loading branch information
MichielDeMey committed Aug 28, 2014
1 parent 5e88789 commit 37e464e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/viewDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 37e464e

Please sign in to comment.