Fire a callback when route is changed (animations, loaders etc) in AngularJS -
Fire a callback when route is changed (animations, loaders etc) in AngularJS -
i rather new angularjs.
when route changed, ng-view changes content. able do, hook on behavior when route changes.
i able illustration animate view we're leaving (fading out, , sliding left) , when next view readily available, fade , slide view in. implemented adding class body on route loading, , removing class on route alter successfull
i ability have views stacked on right of current view, when 1 moves forward, next view first loaded right of current one, viewport slides right current view slides out of view, , next 1 slides view (windows phone off canvas navigation)
is $routeprovider right place this?
are there gurus out there point me in right direction?
after more research, there events fired purpose.
$scope.$on('$routechangestart', function(scope, next, current){ //... }); $scope.$on('$routechangesuccess', function(scope, next, current){ //... });
if ones problem animate (for illustration on route change) recommend using nganimate. read more here
angularjs angularjs-directive
Comments
Post a Comment