0

I'm using AngularJS 1.5 with ngAnimate and ngRoute. I want to animate the ng-view when it changes with ngAnimate. For the animations I'm using animate.css.

The animation basically works but the problem is that ng-enter doesn't wait for ng-leave to finish so that the view which will be loaded next appends to the bottom of the current view for a short moment.

Is there a known solution to this problem?

Yunnigg
  • 55
  • 8
  • Possible duplicate of [during ng-animate of views, "leaving" view still takes up space while "entering" view is animating in](http://stackoverflow.com/questions/18043528/during-ng-animate-of-views-leaving-view-still-takes-up-space-while-entering) – Bruford Apr 25 '16 at 14:52

1 Answers1

0

u can use angur evens on $rootScope e.g.

$rootScope.$on('stateChangeSuccess', function(){
//your stuff
})

and there are other events also.

I know poluuting $rootscope is not a good option generally, but you ca use it if its really required.

or

if you have abstract states then

you can raise similar events from parent states and listen them in child state with $scope. Really depends on architecture of the application.

Ankur Soni
  • 746
  • 6
  • 17