source: trip-planner-front/node_modules/@angular/router/esm2015/src/router_module.js

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

initial commit

  • Property mode set to 100644
File size: 54.4 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 { APP_BASE_HREF, HashLocationStrategy, Location, LOCATION_INITIALIZED, LocationStrategy, PathLocationStrategy, PlatformLocation, ViewportScroller } from '@angular/common';
9import { ANALYZE_FOR_ENTRY_COMPONENTS, APP_BOOTSTRAP_LISTENER, APP_INITIALIZER, ApplicationRef, Compiler, Inject, Injectable, InjectionToken, Injector, NgModule, NgModuleFactoryLoader, NgProbeToken, Optional, SkipSelf, SystemJsNgModuleLoader } from '@angular/core';
10import { of, Subject } from 'rxjs';
11import { EmptyOutletComponent } from './components/empty_outlet';
12import { RouterLink, RouterLinkWithHref } from './directives/router_link';
13import { RouterLinkActive } from './directives/router_link_active';
14import { RouterOutlet } from './directives/router_outlet';
15import { RouteReuseStrategy } from './route_reuse_strategy';
16import { Router } from './router';
17import { ROUTES } from './router_config_loader';
18import { ChildrenOutletContexts } from './router_outlet_context';
19import { NoPreloading, PreloadAllModules, PreloadingStrategy, RouterPreloader } from './router_preloader';
20import { RouterScroller } from './router_scroller';
21import { ActivatedRoute } from './router_state';
22import { UrlHandlingStrategy } from './url_handling_strategy';
23import { DefaultUrlSerializer, UrlSerializer } from './url_tree';
24import { flatten } from './utils/collection';
25/**
26 * The directives defined in the `RouterModule`.
27 */
28const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, EmptyOutletComponent];
29/**
30 * A [DI token](guide/glossary/#di-token) for the router service.
31 *
32 * @publicApi
33 */
34export const ROUTER_CONFIGURATION = new InjectionToken('ROUTER_CONFIGURATION');
35/**
36 * @docsNotRequired
37 */
38export const ROUTER_FORROOT_GUARD = new InjectionToken('ROUTER_FORROOT_GUARD');
39const ɵ0 = { enableTracing: false };
40export const ROUTER_PROVIDERS = [
41 Location,
42 { provide: UrlSerializer, useClass: DefaultUrlSerializer },
43 {
44 provide: Router,
45 useFactory: setupRouter,
46 deps: [
47 UrlSerializer, ChildrenOutletContexts, Location, Injector, NgModuleFactoryLoader, Compiler,
48 ROUTES, ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()],
49 [RouteReuseStrategy, new Optional()]
50 ]
51 },
52 ChildrenOutletContexts,
53 { provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
54 { provide: NgModuleFactoryLoader, useClass: SystemJsNgModuleLoader },
55 RouterPreloader,
56 NoPreloading,
57 PreloadAllModules,
58 { provide: ROUTER_CONFIGURATION, useValue: ɵ0 },
59];
60export function routerNgProbeToken() {
61 return new NgProbeToken('Router', Router);
62}
63/**
64 * @description
65 *
66 * Adds directives and providers for in-app navigation among views defined in an application.
67 * Use the Angular `Router` service to declaratively specify application states and manage state
68 * transitions.
69 *
70 * You can import this NgModule multiple times, once for each lazy-loaded bundle.
71 * However, only one `Router` service can be active.
72 * To ensure this, there are two ways to register routes when importing this module:
73 *
74 * * The `forRoot()` method creates an `NgModule` that contains all the directives, the given
75 * routes, and the `Router` service itself.
76 * * The `forChild()` method creates an `NgModule` that contains all the directives and the given
77 * routes, but does not include the `Router` service.
78 *
79 * @see [Routing and Navigation guide](guide/router) for an
80 * overview of how the `Router` service should be used.
81 *
82 * @publicApi
83 */
84export class RouterModule {
85 // Note: We are injecting the Router so it gets created eagerly...
86 constructor(guard, router) { }
87 /**
88 * Creates and configures a module with all the router providers and directives.
89 * Optionally sets up an application listener to perform an initial navigation.
90 *
91 * When registering the NgModule at the root, import as follows:
92 *
93 * ```
94 * @NgModule({
95 * imports: [RouterModule.forRoot(ROUTES)]
96 * })
97 * class MyNgModule {}
98 * ```
99 *
100 * @param routes An array of `Route` objects that define the navigation paths for the application.
101 * @param config An `ExtraOptions` configuration object that controls how navigation is performed.
102 * @return The new `NgModule`.
103 *
104 */
105 static forRoot(routes, config) {
106 return {
107 ngModule: RouterModule,
108 providers: [
109 ROUTER_PROVIDERS,
110 provideRoutes(routes),
111 {
112 provide: ROUTER_FORROOT_GUARD,
113 useFactory: provideForRootGuard,
114 deps: [[Router, new Optional(), new SkipSelf()]]
115 },
116 { provide: ROUTER_CONFIGURATION, useValue: config ? config : {} },
117 {
118 provide: LocationStrategy,
119 useFactory: provideLocationStrategy,
120 deps: [PlatformLocation, [new Inject(APP_BASE_HREF), new Optional()], ROUTER_CONFIGURATION]
121 },
122 {
123 provide: RouterScroller,
124 useFactory: createRouterScroller,
125 deps: [Router, ViewportScroller, ROUTER_CONFIGURATION]
126 },
127 {
128 provide: PreloadingStrategy,
129 useExisting: config && config.preloadingStrategy ? config.preloadingStrategy :
130 NoPreloading
131 },
132 { provide: NgProbeToken, multi: true, useFactory: routerNgProbeToken },
133 provideRouterInitializer(),
134 ],
135 };
136 }
137 /**
138 * Creates a module with all the router directives and a provider registering routes,
139 * without creating a new Router service.
140 * When registering for submodules and lazy-loaded submodules, create the NgModule as follows:
141 *
142 * ```
143 * @NgModule({
144 * imports: [RouterModule.forChild(ROUTES)]
145 * })
146 * class MyNgModule {}
147 * ```
148 *
149 * @param routes An array of `Route` objects that define the navigation paths for the submodule.
150 * @return The new NgModule.
151 *
152 */
153 static forChild(routes) {
154 return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
155 }
156}
157RouterModule.decorators = [
158 { type: NgModule, args: [{
159 declarations: ROUTER_DIRECTIVES,
160 exports: ROUTER_DIRECTIVES,
161 entryComponents: [EmptyOutletComponent]
162 },] }
163];
164RouterModule.ctorParameters = () => [
165 { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [ROUTER_FORROOT_GUARD,] }] },
166 { type: Router, decorators: [{ type: Optional }] }
167];
168export function createRouterScroller(router, viewportScroller, config) {
169 if (config.scrollOffset) {
170 viewportScroller.setOffset(config.scrollOffset);
171 }
172 return new RouterScroller(router, viewportScroller, config);
173}
174export function provideLocationStrategy(platformLocationStrategy, baseHref, options = {}) {
175 return options.useHash ? new HashLocationStrategy(platformLocationStrategy, baseHref) :
176 new PathLocationStrategy(platformLocationStrategy, baseHref);
177}
178export function provideForRootGuard(router) {
179 if ((typeof ngDevMode === 'undefined' || ngDevMode) && router) {
180 throw new Error(`RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.`);
181 }
182 return 'guarded';
183}
184/**
185 * Registers a [DI provider](guide/glossary#provider) for a set of routes.
186 * @param routes The route configuration to provide.
187 *
188 * @usageNotes
189 *
190 * ```
191 * @NgModule({
192 * imports: [RouterModule.forChild(ROUTES)],
193 * providers: [provideRoutes(EXTRA_ROUTES)]
194 * })
195 * class MyNgModule {}
196 * ```
197 *
198 * @publicApi
199 */
200export function provideRoutes(routes) {
201 return [
202 { provide: ANALYZE_FOR_ENTRY_COMPONENTS, multi: true, useValue: routes },
203 { provide: ROUTES, multi: true, useValue: routes },
204 ];
205}
206export function setupRouter(urlSerializer, contexts, location, injector, loader, compiler, config, opts = {}, urlHandlingStrategy, routeReuseStrategy) {
207 const router = new Router(null, urlSerializer, contexts, location, injector, loader, compiler, flatten(config));
208 if (urlHandlingStrategy) {
209 router.urlHandlingStrategy = urlHandlingStrategy;
210 }
211 if (routeReuseStrategy) {
212 router.routeReuseStrategy = routeReuseStrategy;
213 }
214 assignExtraOptionsToRouter(opts, router);
215 if (opts.enableTracing) {
216 router.events.subscribe((e) => {
217 var _a, _b;
218 // tslint:disable:no-console
219 (_a = console.group) === null || _a === void 0 ? void 0 : _a.call(console, `Router Event: ${e.constructor.name}`);
220 console.log(e.toString());
221 console.log(e);
222 (_b = console.groupEnd) === null || _b === void 0 ? void 0 : _b.call(console);
223 // tslint:enable:no-console
224 });
225 }
226 return router;
227}
228export function assignExtraOptionsToRouter(opts, router) {
229 if (opts.errorHandler) {
230 router.errorHandler = opts.errorHandler;
231 }
232 if (opts.malformedUriErrorHandler) {
233 router.malformedUriErrorHandler = opts.malformedUriErrorHandler;
234 }
235 if (opts.onSameUrlNavigation) {
236 router.onSameUrlNavigation = opts.onSameUrlNavigation;
237 }
238 if (opts.paramsInheritanceStrategy) {
239 router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;
240 }
241 if (opts.relativeLinkResolution) {
242 router.relativeLinkResolution = opts.relativeLinkResolution;
243 }
244 if (opts.urlUpdateStrategy) {
245 router.urlUpdateStrategy = opts.urlUpdateStrategy;
246 }
247}
248export function rootRoute(router) {
249 return router.routerState.root;
250}
251/**
252 * Router initialization requires two steps:
253 *
254 * First, we start the navigation in a `APP_INITIALIZER` to block the bootstrap if
255 * a resolver or a guard executes asynchronously.
256 *
257 * Next, we actually run activation in a `BOOTSTRAP_LISTENER`, using the
258 * `afterPreactivation` hook provided by the router.
259 * The router navigation starts, reaches the point when preactivation is done, and then
260 * pauses. It waits for the hook to be resolved. We then resolve it only in a bootstrap listener.
261 */
262export class RouterInitializer {
263 constructor(injector) {
264 this.injector = injector;
265 this.initNavigation = false;
266 this.destroyed = false;
267 this.resultOfPreactivationDone = new Subject();
268 }
269 appInitializer() {
270 const p = this.injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
271 return p.then(() => {
272 // If the injector was destroyed, the DI lookups below will fail.
273 if (this.destroyed) {
274 return Promise.resolve(true);
275 }
276 let resolve = null;
277 const res = new Promise(r => resolve = r);
278 const router = this.injector.get(Router);
279 const opts = this.injector.get(ROUTER_CONFIGURATION);
280 if (opts.initialNavigation === 'disabled') {
281 router.setUpLocationChangeListener();
282 resolve(true);
283 }
284 else if (
285 // TODO: enabled is deprecated as of v11, can be removed in v13
286 opts.initialNavigation === 'enabled' || opts.initialNavigation === 'enabledBlocking') {
287 router.hooks.afterPreactivation = () => {
288 // only the initial navigation should be delayed
289 if (!this.initNavigation) {
290 this.initNavigation = true;
291 resolve(true);
292 return this.resultOfPreactivationDone;
293 // subsequent navigations should not be delayed
294 }
295 else {
296 return of(null);
297 }
298 };
299 router.initialNavigation();
300 }
301 else {
302 resolve(true);
303 }
304 return res;
305 });
306 }
307 bootstrapListener(bootstrappedComponentRef) {
308 const opts = this.injector.get(ROUTER_CONFIGURATION);
309 const preloader = this.injector.get(RouterPreloader);
310 const routerScroller = this.injector.get(RouterScroller);
311 const router = this.injector.get(Router);
312 const ref = this.injector.get(ApplicationRef);
313 if (bootstrappedComponentRef !== ref.components[0]) {
314 return;
315 }
316 // Default case
317 if (opts.initialNavigation === 'enabledNonBlocking' || opts.initialNavigation === undefined) {
318 router.initialNavigation();
319 }
320 preloader.setUpPreloading();
321 routerScroller.init();
322 router.resetRootComponentType(ref.componentTypes[0]);
323 this.resultOfPreactivationDone.next(null);
324 this.resultOfPreactivationDone.complete();
325 }
326 ngOnDestroy() {
327 this.destroyed = true;
328 }
329}
330RouterInitializer.decorators = [
331 { type: Injectable }
332];
333RouterInitializer.ctorParameters = () => [
334 { type: Injector }
335];
336export function getAppInitializer(r) {
337 return r.appInitializer.bind(r);
338}
339export function getBootstrapListener(r) {
340 return r.bootstrapListener.bind(r);
341}
342/**
343 * A [DI token](guide/glossary/#di-token) for the router initializer that
344 * is called after the app is bootstrapped.
345 *
346 * @publicApi
347 */
348export const ROUTER_INITIALIZER = new InjectionToken('Router Initializer');
349export function provideRouterInitializer() {
350 return [
351 RouterInitializer,
352 {
353 provide: APP_INITIALIZER,
354 multi: true,
355 useFactory: getAppInitializer,
356 deps: [RouterInitializer]
357 },
358 { provide: ROUTER_INITIALIZER, useFactory: getBootstrapListener, deps: [RouterInitializer] },
359 { provide: APP_BOOTSTRAP_LISTENER, multi: true, useExisting: ROUTER_INITIALIZER },
360 ];
361}
362export { ɵ0 };
363//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGVyX21vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3JvdXRlci9zcmMvcm91dGVyX21vZHVs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VJvdXRlckluaXRpYWxpemVyKCk6IFJlYWRvbmx5QXJyYXk8UHJvdmlkZXI+IHtcbiAgcmV0dXJuIFtcbiAgICBSb3V0ZXJJbml0aWFsaXplcixcbiAgICB7XG4gICAgICBwcm92aWRlOiBBUFBfSU5JVElBTElaRVIsXG4gICAgICBtdWx0aTogdHJ1ZSxcbiAgICAgIHVzZUZhY3Rvcnk6IGdldEFwcEluaXRpYWxpemVyLFxuICAgICAgZGVwczogW1JvdXRlckluaXRpYWxpemVyXVxuICAgIH0sXG4gICAge3Byb3ZpZGU6IFJPVVRFUl9JTklUSUFMSVpFUiwgdXNlRmFjdG9yeTogZ2V0Qm9vdHN0cmFwTGlzdGVuZXIsIGRlcHM6IFtSb3V0ZXJJbml0aWFsaXplcl19LFxuICAgIHtwcm92aWRlOiBBUFBfQk9PVFNUUkFQX0xJU1RFTkVSLCBtdWx0aTogdHJ1ZSwgdXNlRXhpc3Rpbmc6IFJPVVRFUl9JTklUSUFMSVpFUn0sXG4gIF07XG59XG4iXX0=
Note: See TracBrowser for help on using the repository browser.