Does anyone know how to trigger an event when an angular route has rendered its view? I'd like to route the application and at the end of the template being rendered I would like it to trigger an event to slide the view "open", so that the User Experience isnt so harsh. When you click on a link the route chnages so quick. I basically want to make the User Experience smoother.
Any ideas?
The $on() method is an event handler, the event which will handle $routeChangeSuccess which gets triggered when route/view change is done.
AngularJS routes enable the user to create different URLs for different content in an application. The ngRoute module helps in accessing different pages of an application without reloading the entire application. Important: $routeProvider is used to configure the routes.
Does this do what you're after?
$scope.$on('$routeChangeSuccess', function () {
// run some code to do your animations
});
Go to http://docs.angularjs.org/api/ and take a look at $route (LHS menu under ngRoute module)
Or take a look at this question I asked....AngularJS - Animate ng-view transitions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With