/
githubmirror
/
angular.js
Обзор
Документация
Войти
/
githubmirror
/
angular.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/e2e/fixtures/anchor-scroll-y-offset/script.js
19 строк
553 B
Michał Gołębiowski
chore(*): switch from JSHint/JSCS to ESLint
05 авг 2016, 23:18
05 авг 2016, 23:18
c322032
Код
Авторство
О чём код?
'use strict'; angular. module('test', []). controller('TestController', function($anchorScroll, $location, $scope) { $anchorScroll.yOffset = 50; $scope.scrollTo = function(target) { if ($location.hash() !== target) { // Set `$location.hash()` to `target` and // `$anchorScroll` will detect the change and scroll $location.hash(target); } else { // The hash is the same, but `target` might be out of view - // explicitly call `$anchorScroll` $anchorScroll(); } }; });