2016-07-20 15:45:04 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
2016-07-19 00:33:02 +03:00
|
|
|
angular.
|
|
|
|
|
module('test', []).
|
|
|
|
|
controller('TestController', function($anchorScroll, $location, $scope) {
|
|
|
|
|
$scope.scrollTo = function(target) {
|
|
|
|
|
// Set `$location.hash()` to `target` and
|
|
|
|
|
// `$anchorScroll` will detect the change and scroll
|
|
|
|
|
$location.hash(target);
|
|
|
|
|
};
|
|
|
|
|
});
|