UNPKG

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