UNPKG

758 BJavaScriptView Raw
1/** @publicapi @module ng1 */ /** */
2import { ng as angular } from './angular';
3/** @hidden */
4function $ViewScrollProvider() {
5 var useAnchorScroll = false;
6 this.useAnchorScroll = function () {
7 useAnchorScroll = true;
8 };
9 this.$get = [
10 '$anchorScroll',
11 '$timeout',
12 function ($anchorScroll, $timeout) {
13 if (useAnchorScroll) {
14 return $anchorScroll;
15 }
16 return function ($element) {
17 return $timeout(function () {
18 $element[0].scrollIntoView();
19 }, 0, false);
20 };
21 },
22 ];
23}
24angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);
25//# sourceMappingURL=viewScroll.js.map
\No newline at end of file