I am currently looking for a software/web development job preferably as a Rails-based developer.
Please email me at weston@westonganger.com. Thanks in advance for any leads!

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 ...

wrmc.run(function($rootScope,$location,$stateParams, $anchorScroll){
  $rootScope.$on('$stateChangeSuccess', function(event, toState){

Related External Links:

Article Topic:Software Development - Angular

Date:July 15, 2015

Recommended Posts