source: trip-planner-front/node_modules/@angular/common/esm2015/src/location/location.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 26.6 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { EventEmitter, Injectable, ɵɵinject } from '@angular/core';
9import { LocationStrategy } from './location_strategy';
10import { PlatformLocation } from './platform_location';
11import { joinWithSlash, normalizeQueryParams, stripTrailingSlash } from './util';
12import * as i0 from "@angular/core";
13/**
14 * @description
15 *
16 * A service that applications can use to interact with a browser's URL.
17 *
18 * Depending on the `LocationStrategy` used, `Location` persists
19 * to the URL's path or the URL's hash segment.
20 *
21 * @usageNotes
22 *
23 * It's better to use the `Router.navigate()` service to trigger route changes. Use
24 * `Location` only if you need to interact with or create normalized URLs outside of
25 * routing.
26 *
27 * `Location` is responsible for normalizing the URL against the application's base href.
28 * A normalized URL is absolute from the URL host, includes the application's base href, and has no
29 * trailing slash:
30 * - `/my/app/user/123` is normalized
31 * - `my/app/user/123` **is not** normalized
32 * - `/my/app/user/123/` **is not** normalized
33 *
34 * ### Example
35 *
36 * <code-example path='common/location/ts/path_location_component.ts'
37 * region='LocationComponent'></code-example>
38 *
39 * @publicApi
40 */
41export class Location {
42 constructor(platformStrategy, platformLocation) {
43 /** @internal */
44 this._subject = new EventEmitter();
45 /** @internal */
46 this._urlChangeListeners = [];
47 this._platformStrategy = platformStrategy;
48 const browserBaseHref = this._platformStrategy.getBaseHref();
49 this._platformLocation = platformLocation;
50 this._baseHref = stripTrailingSlash(_stripIndexHtml(browserBaseHref));
51 this._platformStrategy.onPopState((ev) => {
52 this._subject.emit({
53 'url': this.path(true),
54 'pop': true,
55 'state': ev.state,
56 'type': ev.type,
57 });
58 });
59 }
60 /**
61 * Normalizes the URL path for this location.
62 *
63 * @param includeHash True to include an anchor fragment in the path.
64 *
65 * @returns The normalized URL path.
66 */
67 // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is
68 // removed.
69 path(includeHash = false) {
70 return this.normalize(this._platformStrategy.path(includeHash));
71 }
72 /**
73 * Reports the current state of the location history.
74 * @returns The current value of the `history.state` object.
75 */
76 getState() {
77 return this._platformLocation.getState();
78 }
79 /**
80 * Normalizes the given path and compares to the current normalized path.
81 *
82 * @param path The given URL path.
83 * @param query Query parameters.
84 *
85 * @returns True if the given URL path is equal to the current normalized path, false
86 * otherwise.
87 */
88 isCurrentPathEqualTo(path, query = '') {
89 return this.path() == this.normalize(path + normalizeQueryParams(query));
90 }
91 /**
92 * Normalizes a URL path by stripping any trailing slashes.
93 *
94 * @param url String representing a URL.
95 *
96 * @returns The normalized URL string.
97 */
98 normalize(url) {
99 return Location.stripTrailingSlash(_stripBaseHref(this._baseHref, _stripIndexHtml(url)));
100 }
101 /**
102 * Normalizes an external URL path.
103 * If the given URL doesn't begin with a leading slash (`'/'`), adds one
104 * before normalizing. Adds a hash if `HashLocationStrategy` is
105 * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
106 *
107 * @param url String representing a URL.
108 *
109 * @returns A normalized platform-specific URL.
110 */
111 prepareExternalUrl(url) {
112 if (url && url[0] !== '/') {
113 url = '/' + url;
114 }
115 return this._platformStrategy.prepareExternalUrl(url);
116 }
117 // TODO: rename this method to pushState
118 /**
119 * Changes the browser's URL to a normalized version of a given URL, and pushes a
120 * new item onto the platform's history.
121 *
122 * @param path URL path to normalize.
123 * @param query Query parameters.
124 * @param state Location history state.
125 *
126 */
127 go(path, query = '', state = null) {
128 this._platformStrategy.pushState(state, '', path, query);
129 this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
130 }
131 /**
132 * Changes the browser's URL to a normalized version of the given URL, and replaces
133 * the top item on the platform's history stack.
134 *
135 * @param path URL path to normalize.
136 * @param query Query parameters.
137 * @param state Location history state.
138 */
139 replaceState(path, query = '', state = null) {
140 this._platformStrategy.replaceState(state, '', path, query);
141 this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
142 }
143 /**
144 * Navigates forward in the platform's history.
145 */
146 forward() {
147 this._platformStrategy.forward();
148 }
149 /**
150 * Navigates back in the platform's history.
151 */
152 back() {
153 this._platformStrategy.back();
154 }
155 /**
156 * Navigate to a specific page from session history, identified by its relative position to the
157 * current page.
158 *
159 * @param relativePosition Position of the target page in the history relative to the current
160 * page.
161 * A negative value moves backwards, a positive value moves forwards, e.g. `location.historyGo(2)`
162 * moves forward two pages and `location.historyGo(-2)` moves back two pages. When we try to go
163 * beyond what's stored in the history session, we stay in the current page. Same behaviour occurs
164 * when `relativePosition` equals 0.
165 * @see https://developer.mozilla.org/en-US/docs/Web/API/History_API#Moving_to_a_specific_point_in_history
166 */
167 historyGo(relativePosition = 0) {
168 var _a, _b;
169 (_b = (_a = this._platformStrategy).historyGo) === null || _b === void 0 ? void 0 : _b.call(_a, relativePosition);
170 }
171 /**
172 * Registers a URL change listener. Use to catch updates performed by the Angular
173 * framework that are not detectible through "popstate" or "hashchange" events.
174 *
175 * @param fn The change handler function, which take a URL and a location history state.
176 */
177 onUrlChange(fn) {
178 this._urlChangeListeners.push(fn);
179 if (!this._urlChangeSubscription) {
180 this._urlChangeSubscription = this.subscribe(v => {
181 this._notifyUrlChangeListeners(v.url, v.state);
182 });
183 }
184 }
185 /** @internal */
186 _notifyUrlChangeListeners(url = '', state) {
187 this._urlChangeListeners.forEach(fn => fn(url, state));
188 }
189 /**
190 * Subscribes to the platform's `popState` events.
191 *
192 * Note: `Location.go()` does not trigger the `popState` event in the browser. Use
193 * `Location.onUrlChange()` to subscribe to URL changes instead.
194 *
195 * @param value Event that is triggered when the state history changes.
196 * @param exception The exception to throw.
197 *
198 * @see [onpopstate](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate)
199 *
200 * @returns Subscribed events.
201 */
202 subscribe(onNext, onThrow, onReturn) {
203 return this._subject.subscribe({ next: onNext, error: onThrow, complete: onReturn });
204 }
205}
206/**
207 * Normalizes URL parameters by prepending with `?` if needed.
208 *
209 * @param params String of URL parameters.
210 *
211 * @returns The normalized URL parameters string.
212 */
213Location.normalizeQueryParams = normalizeQueryParams;
214/**
215 * Joins two parts of a URL with a slash if needed.
216 *
217 * @param start URL string
218 * @param end URL string
219 *
220 *
221 * @returns The joined URL string.
222 */
223Location.joinWithSlash = joinWithSlash;
224/**
225 * Removes a trailing slash from a URL string if needed.
226 * Looks for the first occurrence of either `#`, `?`, or the end of the
227 * line as `/` characters and removes the trailing slash if one exists.
228 *
229 * @param url URL string.
230 *
231 * @returns The URL string, modified if needed.
232 */
233Location.stripTrailingSlash = stripTrailingSlash;
234Location.ɵprov = i0.ɵɵdefineInjectable({ factory: createLocation, token: Location, providedIn: "root" });
235Location.decorators = [
236 { type: Injectable, args: [{
237 providedIn: 'root',
238 // See #23917
239 useFactory: createLocation,
240 },] }
241];
242Location.ctorParameters = () => [
243 { type: LocationStrategy },
244 { type: PlatformLocation }
245];
246export function createLocation() {
247 return new Location(ɵɵinject(LocationStrategy), ɵɵinject(PlatformLocation));
248}
249function _stripBaseHref(baseHref, url) {
250 return baseHref && url.startsWith(baseHref) ? url.substring(baseHref.length) : url;
251}
252function _stripIndexHtml(url) {
253 return url.replace(/\/index.html$/, '');
254}
255//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21tb24vc3JjL2xvY2F0aW9uL2xvY2F0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBQyxZQUFZLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUVqR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