0

I'm using angular route to change views in my app. When changing views (user clicks on a link) the new view is added at the bottom and the old view stays there for about 1 second before disapperaring.

When listening to $routeChangeStart/success and $viewContentLoaded I can see the new view actually loads very quick, just the old view isn't hidden quick enough.

Any ideas?

Html

<div class="content container-fluid"  ng-view id="main"></div>

Code

    config(['$routeProvider', function ($routeProvider) {
    $routeProvider.when('/dashboard:l3_outputmaterial_id?', { templateUrl: 'app/frontend/inline/dashboard.html', controller: 'dashboardCtrl' });
    $routeProvider.when('/nicetohave', { templateUrl: 'app/frontend/nice/nicetohave.html', controller: 'niceToHaveCtrl' });
    $routeProvider.when('/login/:return_url', { templateUrl: 'app/frontend/auth/login.html', controller: 'loginCtrl' });
}])
Elger Mensonides
  • 6,930
  • 6
  • 46
  • 69
  • Share your html code where you've ng-view and also your listener code – mohamedrias Apr 03 '15 at 13:55
  • 1
    ng-animate does this, check for answer here: http://stackoverflow.com/questions/28120025/angularjs-nghide-delayed-with-ngshow/28120157#28120157 – Ins Apr 03 '15 at 14:52
  • @Ins thanks, the answer worked. Strange though because when I remove ngaminate alltogether the delay is still there. – Elger Mensonides Apr 07 '15 at 07:21

1 Answers1

0

Ins answered in the comments:

ng-animate does this, check for answer here: angularjs ngHide delayed with ngShow

Strange though because when I remove ngaminate alltogether the delay is still there.

Community
  • 1
  • 1
Elger Mensonides
  • 6,930
  • 6
  • 46
  • 69
  • are you sure no other module dependent on ngAnimate? Have you tried $animateProvider.classNameFilter ? – Ins Apr 07 '15 at 10:46
  • yes, that does it for me, I got angularstrap that uses ngAnimate. But if I remove nganimate altogether (remove .js and module reference) it still is there. Pretty weird. – Elger Mensonides Apr 07 '15 at 12:11