1 | "use strict";
|
2 | var __extends = (this && this.__extends) || (function () {
|
3 | var extendStatics = function (d, b) {
|
4 | extendStatics = Object.setPrototypeOf ||
|
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
7 | return extendStatics(d, b);
|
8 | };
|
9 | return function (d, b) {
|
10 | extendStatics(d, b);
|
11 | function __() { this.constructor = d; }
|
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
13 | };
|
14 | })();
|
15 | Object.defineProperty(exports, "__esModule", { value: true });
|
16 | exports.HashLocationService = void 0;
|
17 | var common_1 = require("../common");
|
18 | var baseLocationService_1 = require("./baseLocationService");
|
19 |
|
20 | var HashLocationService = (function (_super) {
|
21 | __extends(HashLocationService, _super);
|
22 | function HashLocationService(router) {
|
23 | var _this = _super.call(this, router, false) || this;
|
24 | common_1.root.addEventListener('hashchange', _this._listener, false);
|
25 | return _this;
|
26 | }
|
27 | HashLocationService.prototype._get = function () {
|
28 | return common_1.trimHashVal(this._location.hash);
|
29 | };
|
30 | HashLocationService.prototype._set = function (state, title, url, replace) {
|
31 | this._location.hash = url;
|
32 | };
|
33 | HashLocationService.prototype.dispose = function (router) {
|
34 | _super.prototype.dispose.call(this, router);
|
35 | common_1.root.removeEventListener('hashchange', this._listener);
|
36 | };
|
37 | return HashLocationService;
|
38 | }(baseLocationService_1.BaseLocationServices));
|
39 | exports.HashLocationService = HashLocationService;
|
40 |
|
\ | No newline at end of file |