diff --git a/src/ng/anchorScroll.js b/src/ng/anchorScroll.js index 749d693d..3b25bfe4 100644 --- a/src/ng/anchorScroll.js +++ b/src/ng/anchorScroll.js @@ -17,24 +17,26 @@ * This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`. * * @example - + -
+
Go to bottom You're at the bottom!
- function ScrollCtrl($scope, $location, $anchorScroll) { - $scope.gotoBottom = function (){ - // set the location.hash to the id of - // the element you wish to scroll to. - $location.hash('bottom'); + angular.module('anchorScrollExample', []) + .controller('ScrollController', ['$scope', '$location', '$anchorScroll', + function ($scope, $location, $anchorScroll) { + $scope.gotoBottom = function() { + // set the location.hash to the id of + // the element you wish to scroll to. + $location.hash('bottom'); - // call $anchorScroll() - $anchorScroll(); - }; - } + // call $anchorScroll() + $anchorScroll(); + }; + }]); #scrollArea {