Automatically Scroll To Top Of Page With UI-Router In AngularJS

Posted By Weston Ganger

I thought its a little stupid that ui-router doesnt scroll to the top of the page upon a state change by default. Here I will show you how to make it scroll to top.

myApp.config(function($stateProvider, $urlRouterProvider,$locationProvider,$uiViewScrollProvider){

  ... other config ...
});$rootScope,$location,$stateParams, $anchorScroll){
  $rootScope.$on('$stateChangeSuccess', function(event, toState){

Related External Links:

Article Topic:Software Development - Javascript

Date:July 15, 2015