@angular/router 13.0.0-next.0 → 13.0.0-next.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/esm2020/router.mjs +5 -0
- package/{esm2015/src/apply_redirects.js → esm2020/src/apply_redirects.mjs} +0 -0
- package/esm2020/src/components/empty_outlet.mjs +29 -0
- package/esm2020/src/config.mjs +14 -0
- package/{esm2015/src/create_router_state.js → esm2020/src/create_router_state.mjs} +0 -0
- package/{esm2015/src/create_url_tree.js → esm2020/src/create_url_tree.mjs} +0 -0
- package/esm2020/src/directives/router_link.mjs +353 -0
- package/esm2020/src/directives/router_link_active.mjs +215 -0
- package/esm2020/src/directives/router_outlet.mjs +219 -0
- package/{esm2015/src/events.js → esm2020/src/events.mjs} +1 -1
- package/{esm2015/src/index.js → esm2020/src/index.mjs} +1 -1
- package/{esm2015/src/interfaces.js → esm2020/src/interfaces.mjs} +1 -1
- package/{esm2015/src/operators/activate_routes.js → esm2020/src/operators/activate_routes.mjs} +0 -0
- package/esm2020/src/operators/apply_redirects.mjs +14 -0
- package/esm2020/src/operators/check_guards.mjs +138 -0
- package/{esm2015/src/operators/prioritized_guard_value.js → esm2020/src/operators/prioritized_guard_value.mjs} +0 -0
- package/esm2020/src/operators/recognize.mjs +14 -0
- package/esm2020/src/operators/resolve_data.mjs +59 -0
- package/{esm2015/src/operators/switch_tap.js → esm2020/src/operators/switch_tap.mjs} +0 -0
- package/{esm2015/src/private_export.js → esm2020/src/private_export.mjs} +0 -0
- package/esm2020/src/recognize.mjs +262 -0
- package/{esm2015/src/route_reuse_strategy.js → esm2020/src/route_reuse_strategy.mjs} +0 -0
- package/esm2020/src/router.mjs +1009 -0
- package/esm2020/src/router_config_loader.mjs +71 -0
- package/esm2020/src/router_module.mjs +367 -0
- package/esm2020/src/router_outlet_context.mjs +74 -0
- package/esm2020/src/router_preloader.mjs +127 -0
- package/esm2020/src/router_scroller.mjs +95 -0
- package/esm2020/src/router_state.mjs +404 -0
- package/{esm2015/src/shared.js → esm2020/src/shared.mjs} +0 -0
- package/{esm2015/src/url_handling_strategy.js → esm2020/src/url_handling_strategy.mjs} +0 -0
- package/{esm2015/src/url_tree.js → esm2020/src/url_tree.mjs} +2 -2
- package/{esm2015/src/utils/collection.js → esm2020/src/utils/collection.mjs} +0 -0
- package/{esm2015/src/utils/config.js → esm2020/src/utils/config.mjs} +2 -2
- package/esm2020/src/utils/config_matching.mjs +145 -0
- package/{esm2015/src/utils/preactivation.js → esm2020/src/utils/preactivation.mjs} +0 -0
- package/{esm2015/src/utils/tree.js → esm2020/src/utils/tree.mjs} +0 -0
- package/{esm2015/src/utils/type_guards.js → esm2020/src/utils/type_guards.mjs} +0 -0
- package/{esm2015/src/version.js → esm2020/src/version.mjs} +1 -1
- package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
- package/{esm2015/testing/public_api.js → esm2020/testing/public_api.mjs} +0 -0
- package/esm2020/testing/src/extra_router_testing_providers.mjs +10 -0
- package/esm2020/testing/src/router_testing_module.mjs +122 -0
- package/esm2020/testing/src/spy_ng_module_factory_loader.mjs +10 -0
- package/esm2020/testing/src/testing.mjs +15 -0
- package/{esm2015/testing/testing.js → esm2020/testing/testing.mjs} +0 -0
- package/{esm2015/upgrade/index.js → esm2020/upgrade/index.mjs} +0 -0
- package/{esm2015/upgrade/public_api.js → esm2020/upgrade/public_api.mjs} +0 -0
- package/esm2020/upgrade/src/upgrade.mjs +120 -0
- package/{esm2015/upgrade/upgrade.js → esm2020/upgrade/upgrade.mjs} +0 -0
- package/fesm2015/{router.js → router.mjs} +626 -581
- package/fesm2015/router.mjs.map +1 -0
- package/fesm2015/testing.mjs +179 -0
- package/fesm2015/testing.mjs.map +1 -0
- package/fesm2015/{upgrade.js → upgrade.mjs} +4 -5
- package/fesm2015/upgrade.mjs.map +1 -0
- package/fesm2020/router.mjs +6163 -0
- package/fesm2020/router.mjs.map +1 -0
- package/fesm2020/testing.mjs +179 -0
- package/fesm2020/testing.mjs.map +1 -0
- package/fesm2020/upgrade.mjs +150 -0
- package/fesm2020/upgrade.mjs.map +1 -0
- package/package.json +34 -10
- package/router.d.ts +186 -143
- package/testing/package.json +5 -5
- package/testing/testing.d.ts +9 -66
- package/upgrade/package.json +5 -5
- package/upgrade/upgrade.d.ts +1 -1
- package/bundles/router-testing.umd.js +0 -541
- package/bundles/router-testing.umd.js.map +0 -1
- package/bundles/router-upgrade.umd.js +0 -157
- package/bundles/router-upgrade.umd.js.map +0 -1
- package/bundles/router.umd.js +0 -6840
- package/bundles/router.umd.js.map +0 -1
- package/esm2015/router.externs.js +0 -6
- package/esm2015/router.js +0 -9
- package/esm2015/src/components/empty_outlet.js +0 -24
- package/esm2015/src/config.js +0 -14
- package/esm2015/src/directives/router_link.js +0 -293
- package/esm2015/src/directives/router_link_active.js +0 -184
- package/esm2015/src/directives/router_outlet.js +0 -193
- package/esm2015/src/operators/apply_redirects.js +0 -14
- package/esm2015/src/operators/check_guards.js +0 -138
- package/esm2015/src/operators/recognize.js +0 -14
- package/esm2015/src/operators/resolve_data.js +0 -56
- package/esm2015/src/recognize.js +0 -262
- package/esm2015/src/router.js +0 -1046
- package/esm2015/src/router_config_loader.js +0 -76
- package/esm2015/src/router_module.js +0 -363
- package/esm2015/src/router_outlet_context.js +0 -73
- package/esm2015/src/router_preloader.js +0 -130
- package/esm2015/src/router_scroller.js +0 -95
- package/esm2015/src/router_state.js +0 -404
- package/esm2015/src/utils/config_matching.js +0 -145
- package/esm2015/testing/src/router_testing_module.js +0 -166
- package/esm2015/testing/src/testing.js +0 -14
- package/esm2015/testing/testing.externs.js +0 -6
- package/esm2015/upgrade/src/upgrade.js +0 -122
- package/esm2015/upgrade/upgrade.externs.js +0 -6
- package/fesm2015/router.js.map +0 -1
- package/fesm2015/testing.js +0 -204
- package/fesm2015/testing.js.map +0 -1
- package/fesm2015/upgrade.js.map +0 -1
- package/router.metadata.json +0 -1
- package/testing/testing.metadata.json +0 -1
- package/testing.d.ts +0 -7
- package/testing.metadata.json +0 -1
- package/upgrade/upgrade.metadata.json +0 -1
- package/upgrade.d.ts +0 -7
- package/upgrade.metadata.json +0 -1
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v13.0.0-next.
|
|
2
|
+
* @license Angular v13.0.0-next.12
|
|
3
3
|
* (c) 2010-2021 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
import { ɵisObservable, ɵisPromise, Component, NgModuleRef, InjectionToken, InjectFlags, NgModuleFactory, ɵConsole, NgZone, Injectable,
|
|
7
|
+
import * as i0 from '@angular/core';
|
|
8
|
+
import { ɵisObservable, ɵisPromise, EventEmitter, Directive, Attribute, Output, Component, NgModuleRef, InjectionToken, InjectFlags, NgModuleFactory, ɵConsole, NgZone, Injectable, Input, HostListener, HostBinding, Optional, ContentChildren, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, Inject, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, ApplicationRef, Version } from '@angular/core';
|
|
9
9
|
import { from, of, BehaviorSubject, combineLatest, Observable, EmptyError, concat, defer, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
10
10
|
import { map, switchMap, take, startWith, scan, filter, catchError, concatMap, last as last$1, first, mergeMap, tap, takeLast, refCount, finalize, mergeAll } from 'rxjs/operators';
|
|
11
|
+
import * as i3 from '@angular/common';
|
|
12
|
+
import { Location, LocationStrategy, PlatformLocation, APP_BASE_HREF, ViewportScroller, HashLocationStrategy, PathLocationStrategy, LOCATION_INITIALIZED } from '@angular/common';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* @license
|
|
@@ -992,7 +994,7 @@ function matchQueryParams(str) {
|
|
|
992
994
|
const match = str.match(QUERY_PARAM_RE);
|
|
993
995
|
return match ? match[0] : '';
|
|
994
996
|
}
|
|
995
|
-
const QUERY_PARAM_VALUE_RE = /^[
|
|
997
|
+
const QUERY_PARAM_VALUE_RE = /^[^&#]+/;
|
|
996
998
|
// Return the value of the query param at the start of the string or an empty string
|
|
997
999
|
function matchUrlQueryParamValue(str) {
|
|
998
1000
|
const match = str.match(QUERY_PARAM_VALUE_RE);
|
|
@@ -2280,6 +2282,295 @@ function prioritizedGuardValue() {
|
|
|
2280
2282
|
});
|
|
2281
2283
|
}
|
|
2282
2284
|
|
|
2285
|
+
/**
|
|
2286
|
+
* @license
|
|
2287
|
+
* Copyright Google LLC All Rights Reserved.
|
|
2288
|
+
*
|
|
2289
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
2290
|
+
* found in the LICENSE file at https://angular.io/license
|
|
2291
|
+
*/
|
|
2292
|
+
/**
|
|
2293
|
+
* Store contextual information about a `RouterOutlet`
|
|
2294
|
+
*
|
|
2295
|
+
* @publicApi
|
|
2296
|
+
*/
|
|
2297
|
+
class OutletContext {
|
|
2298
|
+
constructor() {
|
|
2299
|
+
this.outlet = null;
|
|
2300
|
+
this.route = null;
|
|
2301
|
+
this.resolver = null;
|
|
2302
|
+
this.children = new ChildrenOutletContexts();
|
|
2303
|
+
this.attachRef = null;
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
/**
|
|
2307
|
+
* Store contextual information about the children (= nested) `RouterOutlet`
|
|
2308
|
+
*
|
|
2309
|
+
* @publicApi
|
|
2310
|
+
*/
|
|
2311
|
+
class ChildrenOutletContexts {
|
|
2312
|
+
constructor() {
|
|
2313
|
+
// contexts for child outlets, by name.
|
|
2314
|
+
this.contexts = new Map();
|
|
2315
|
+
}
|
|
2316
|
+
/** Called when a `RouterOutlet` directive is instantiated */
|
|
2317
|
+
onChildOutletCreated(childName, outlet) {
|
|
2318
|
+
const context = this.getOrCreateContext(childName);
|
|
2319
|
+
context.outlet = outlet;
|
|
2320
|
+
this.contexts.set(childName, context);
|
|
2321
|
+
}
|
|
2322
|
+
/**
|
|
2323
|
+
* Called when a `RouterOutlet` directive is destroyed.
|
|
2324
|
+
* We need to keep the context as the outlet could be destroyed inside a NgIf and might be
|
|
2325
|
+
* re-created later.
|
|
2326
|
+
*/
|
|
2327
|
+
onChildOutletDestroyed(childName) {
|
|
2328
|
+
const context = this.getContext(childName);
|
|
2329
|
+
if (context) {
|
|
2330
|
+
context.outlet = null;
|
|
2331
|
+
context.attachRef = null;
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
/**
|
|
2335
|
+
* Called when the corresponding route is deactivated during navigation.
|
|
2336
|
+
* Because the component get destroyed, all children outlet are destroyed.
|
|
2337
|
+
*/
|
|
2338
|
+
onOutletDeactivated() {
|
|
2339
|
+
const contexts = this.contexts;
|
|
2340
|
+
this.contexts = new Map();
|
|
2341
|
+
return contexts;
|
|
2342
|
+
}
|
|
2343
|
+
onOutletReAttached(contexts) {
|
|
2344
|
+
this.contexts = contexts;
|
|
2345
|
+
}
|
|
2346
|
+
getOrCreateContext(childName) {
|
|
2347
|
+
let context = this.getContext(childName);
|
|
2348
|
+
if (!context) {
|
|
2349
|
+
context = new OutletContext();
|
|
2350
|
+
this.contexts.set(childName, context);
|
|
2351
|
+
}
|
|
2352
|
+
return context;
|
|
2353
|
+
}
|
|
2354
|
+
getContext(childName) {
|
|
2355
|
+
return this.contexts.get(childName) || null;
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
/**
|
|
2360
|
+
* @license
|
|
2361
|
+
* Copyright Google LLC All Rights Reserved.
|
|
2362
|
+
*
|
|
2363
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
2364
|
+
* found in the LICENSE file at https://angular.io/license
|
|
2365
|
+
*/
|
|
2366
|
+
/**
|
|
2367
|
+
* @description
|
|
2368
|
+
*
|
|
2369
|
+
* Acts as a placeholder that Angular dynamically fills based on the current router state.
|
|
2370
|
+
*
|
|
2371
|
+
* Each outlet can have a unique name, determined by the optional `name` attribute.
|
|
2372
|
+
* The name cannot be set or changed dynamically. If not set, default value is "primary".
|
|
2373
|
+
*
|
|
2374
|
+
* ```
|
|
2375
|
+
* <router-outlet></router-outlet>
|
|
2376
|
+
* <router-outlet name='left'></router-outlet>
|
|
2377
|
+
* <router-outlet name='right'></router-outlet>
|
|
2378
|
+
* ```
|
|
2379
|
+
*
|
|
2380
|
+
* Named outlets can be the targets of secondary routes.
|
|
2381
|
+
* The `Route` object for a secondary route has an `outlet` property to identify the target outlet:
|
|
2382
|
+
*
|
|
2383
|
+
* `{path: <base-path>, component: <component>, outlet: <target_outlet_name>}`
|
|
2384
|
+
*
|
|
2385
|
+
* Using named outlets and secondary routes, you can target multiple outlets in
|
|
2386
|
+
* the same `RouterLink` directive.
|
|
2387
|
+
*
|
|
2388
|
+
* The router keeps track of separate branches in a navigation tree for each named outlet and
|
|
2389
|
+
* generates a representation of that tree in the URL.
|
|
2390
|
+
* The URL for a secondary route uses the following syntax to specify both the primary and secondary
|
|
2391
|
+
* routes at the same time:
|
|
2392
|
+
*
|
|
2393
|
+
* `http://base-path/primary-route-path(outlet-name:route-path)`
|
|
2394
|
+
*
|
|
2395
|
+
* A router outlet emits an activate event when a new component is instantiated,
|
|
2396
|
+
* deactivate event when a component is destroyed.
|
|
2397
|
+
* An attached event emits when the `RouteReuseStrategy` instructs the outlet to reattach the
|
|
2398
|
+
* subtree, and the detached event emits when the `RouteReuseStrategy` instructs the outlet to
|
|
2399
|
+
* detach the subtree.
|
|
2400
|
+
*
|
|
2401
|
+
* ```
|
|
2402
|
+
* <router-outlet
|
|
2403
|
+
* (activate)='onActivate($event)'
|
|
2404
|
+
* (deactivate)='onDeactivate($event)'
|
|
2405
|
+
* (attach)='onAttach($event)'
|
|
2406
|
+
* (detach)='onDetach($event)'></router-outlet>
|
|
2407
|
+
* ```
|
|
2408
|
+
*
|
|
2409
|
+
* @see [Routing tutorial](guide/router-tutorial-toh#named-outlets "Example of a named
|
|
2410
|
+
* outlet and secondary route configuration").
|
|
2411
|
+
* @see `RouterLink`
|
|
2412
|
+
* @see `Route`
|
|
2413
|
+
* @ngModule RouterModule
|
|
2414
|
+
*
|
|
2415
|
+
* @publicApi
|
|
2416
|
+
*/
|
|
2417
|
+
class RouterOutlet {
|
|
2418
|
+
constructor(parentContexts, location, resolver, name, changeDetector) {
|
|
2419
|
+
this.parentContexts = parentContexts;
|
|
2420
|
+
this.location = location;
|
|
2421
|
+
this.resolver = resolver;
|
|
2422
|
+
this.changeDetector = changeDetector;
|
|
2423
|
+
this.activated = null;
|
|
2424
|
+
this._activatedRoute = null;
|
|
2425
|
+
this.activateEvents = new EventEmitter();
|
|
2426
|
+
this.deactivateEvents = new EventEmitter();
|
|
2427
|
+
/**
|
|
2428
|
+
* Emits an attached component instance when the `RouteReuseStrategy` instructs to re-attach a
|
|
2429
|
+
* previously detached subtree.
|
|
2430
|
+
**/
|
|
2431
|
+
this.attachEvents = new EventEmitter();
|
|
2432
|
+
/**
|
|
2433
|
+
* Emits a detached component instance when the `RouteReuseStrategy` instructs to detach the
|
|
2434
|
+
* subtree.
|
|
2435
|
+
*/
|
|
2436
|
+
this.detachEvents = new EventEmitter();
|
|
2437
|
+
this.name = name || PRIMARY_OUTLET;
|
|
2438
|
+
parentContexts.onChildOutletCreated(this.name, this);
|
|
2439
|
+
}
|
|
2440
|
+
/** @nodoc */
|
|
2441
|
+
ngOnDestroy() {
|
|
2442
|
+
this.parentContexts.onChildOutletDestroyed(this.name);
|
|
2443
|
+
}
|
|
2444
|
+
/** @nodoc */
|
|
2445
|
+
ngOnInit() {
|
|
2446
|
+
if (!this.activated) {
|
|
2447
|
+
// If the outlet was not instantiated at the time the route got activated we need to populate
|
|
2448
|
+
// the outlet when it is initialized (ie inside a NgIf)
|
|
2449
|
+
const context = this.parentContexts.getContext(this.name);
|
|
2450
|
+
if (context && context.route) {
|
|
2451
|
+
if (context.attachRef) {
|
|
2452
|
+
// `attachRef` is populated when there is an existing component to mount
|
|
2453
|
+
this.attach(context.attachRef, context.route);
|
|
2454
|
+
}
|
|
2455
|
+
else {
|
|
2456
|
+
// otherwise the component defined in the configuration is created
|
|
2457
|
+
this.activateWith(context.route, context.resolver || null);
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
get isActivated() {
|
|
2463
|
+
return !!this.activated;
|
|
2464
|
+
}
|
|
2465
|
+
/**
|
|
2466
|
+
* @returns The currently activated component instance.
|
|
2467
|
+
* @throws An error if the outlet is not activated.
|
|
2468
|
+
*/
|
|
2469
|
+
get component() {
|
|
2470
|
+
if (!this.activated)
|
|
2471
|
+
throw new Error('Outlet is not activated');
|
|
2472
|
+
return this.activated.instance;
|
|
2473
|
+
}
|
|
2474
|
+
get activatedRoute() {
|
|
2475
|
+
if (!this.activated)
|
|
2476
|
+
throw new Error('Outlet is not activated');
|
|
2477
|
+
return this._activatedRoute;
|
|
2478
|
+
}
|
|
2479
|
+
get activatedRouteData() {
|
|
2480
|
+
if (this._activatedRoute) {
|
|
2481
|
+
return this._activatedRoute.snapshot.data;
|
|
2482
|
+
}
|
|
2483
|
+
return {};
|
|
2484
|
+
}
|
|
2485
|
+
/**
|
|
2486
|
+
* Called when the `RouteReuseStrategy` instructs to detach the subtree
|
|
2487
|
+
*/
|
|
2488
|
+
detach() {
|
|
2489
|
+
if (!this.activated)
|
|
2490
|
+
throw new Error('Outlet is not activated');
|
|
2491
|
+
this.location.detach();
|
|
2492
|
+
const cmp = this.activated;
|
|
2493
|
+
this.activated = null;
|
|
2494
|
+
this._activatedRoute = null;
|
|
2495
|
+
this.detachEvents.emit(cmp.instance);
|
|
2496
|
+
return cmp;
|
|
2497
|
+
}
|
|
2498
|
+
/**
|
|
2499
|
+
* Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree
|
|
2500
|
+
*/
|
|
2501
|
+
attach(ref, activatedRoute) {
|
|
2502
|
+
this.activated = ref;
|
|
2503
|
+
this._activatedRoute = activatedRoute;
|
|
2504
|
+
this.location.insert(ref.hostView);
|
|
2505
|
+
this.attachEvents.emit(ref.instance);
|
|
2506
|
+
}
|
|
2507
|
+
deactivate() {
|
|
2508
|
+
if (this.activated) {
|
|
2509
|
+
const c = this.component;
|
|
2510
|
+
this.activated.destroy();
|
|
2511
|
+
this.activated = null;
|
|
2512
|
+
this._activatedRoute = null;
|
|
2513
|
+
this.deactivateEvents.emit(c);
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
activateWith(activatedRoute, resolver) {
|
|
2517
|
+
if (this.isActivated) {
|
|
2518
|
+
throw new Error('Cannot activate an already activated outlet');
|
|
2519
|
+
}
|
|
2520
|
+
this._activatedRoute = activatedRoute;
|
|
2521
|
+
const snapshot = activatedRoute._futureSnapshot;
|
|
2522
|
+
const component = snapshot.routeConfig.component;
|
|
2523
|
+
resolver = resolver || this.resolver;
|
|
2524
|
+
const factory = resolver.resolveComponentFactory(component);
|
|
2525
|
+
const childContexts = this.parentContexts.getOrCreateContext(this.name).children;
|
|
2526
|
+
const injector = new OutletInjector(activatedRoute, childContexts, this.location.injector);
|
|
2527
|
+
this.activated = this.location.createComponent(factory, this.location.length, injector);
|
|
2528
|
+
// Calling `markForCheck` to make sure we will run the change detection when the
|
|
2529
|
+
// `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component.
|
|
2530
|
+
this.changeDetector.markForCheck();
|
|
2531
|
+
this.activateEvents.emit(this.activated.instance);
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: i0.ComponentFactoryResolver }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2535
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.12", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
|
|
2536
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2537
|
+
type: Directive,
|
|
2538
|
+
args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
|
|
2539
|
+
}], ctorParameters: function () {
|
|
2540
|
+
return [{ type: ChildrenOutletContexts }, { type: i0.ViewContainerRef }, { type: i0.ComponentFactoryResolver }, { type: undefined, decorators: [{
|
|
2541
|
+
type: Attribute,
|
|
2542
|
+
args: ['name']
|
|
2543
|
+
}] }, { type: i0.ChangeDetectorRef }];
|
|
2544
|
+
}, propDecorators: { activateEvents: [{
|
|
2545
|
+
type: Output,
|
|
2546
|
+
args: ['activate']
|
|
2547
|
+
}], deactivateEvents: [{
|
|
2548
|
+
type: Output,
|
|
2549
|
+
args: ['deactivate']
|
|
2550
|
+
}], attachEvents: [{
|
|
2551
|
+
type: Output,
|
|
2552
|
+
args: ['attach']
|
|
2553
|
+
}], detachEvents: [{
|
|
2554
|
+
type: Output,
|
|
2555
|
+
args: ['detach']
|
|
2556
|
+
}] } });
|
|
2557
|
+
class OutletInjector {
|
|
2558
|
+
constructor(route, childContexts, parent) {
|
|
2559
|
+
this.route = route;
|
|
2560
|
+
this.childContexts = childContexts;
|
|
2561
|
+
this.parent = parent;
|
|
2562
|
+
}
|
|
2563
|
+
get(token, notFoundValue) {
|
|
2564
|
+
if (token === ActivatedRoute) {
|
|
2565
|
+
return this.route;
|
|
2566
|
+
}
|
|
2567
|
+
if (token === ChildrenOutletContexts) {
|
|
2568
|
+
return this.childContexts;
|
|
2569
|
+
}
|
|
2570
|
+
return this.parent.get(token, notFoundValue);
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2283
2574
|
/**
|
|
2284
2575
|
* @license
|
|
2285
2576
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -2298,9 +2589,12 @@ function prioritizedGuardValue() {
|
|
|
2298
2589
|
*/
|
|
2299
2590
|
class ɵEmptyOutletComponent {
|
|
2300
2591
|
}
|
|
2301
|
-
ɵEmptyOutletComponent
|
|
2302
|
-
|
|
2303
|
-
|
|
2592
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2593
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0-next.12", type: ɵEmptyOutletComponent, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, directives: [{ type: RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
|
|
2594
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2595
|
+
type: Component,
|
|
2596
|
+
args: [{ template: `<router-outlet></router-outlet>` }]
|
|
2597
|
+
}] });
|
|
2304
2598
|
|
|
2305
2599
|
/**
|
|
2306
2600
|
* @license
|
|
@@ -2428,7 +2722,7 @@ function sortByMatchingOutlets(routes, outletName) {
|
|
|
2428
2722
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2429
2723
|
* found in the LICENSE file at https://angular.io/license
|
|
2430
2724
|
*/
|
|
2431
|
-
const noMatch = {
|
|
2725
|
+
const noMatch$1 = {
|
|
2432
2726
|
matched: false,
|
|
2433
2727
|
consumedSegments: [],
|
|
2434
2728
|
lastChild: 0,
|
|
@@ -2439,7 +2733,7 @@ function match(segmentGroup, route, segments) {
|
|
|
2439
2733
|
var _a;
|
|
2440
2734
|
if (route.path === '') {
|
|
2441
2735
|
if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || segments.length > 0)) {
|
|
2442
|
-
return Object.assign({}, noMatch);
|
|
2736
|
+
return Object.assign({}, noMatch$1);
|
|
2443
2737
|
}
|
|
2444
2738
|
return {
|
|
2445
2739
|
matched: true,
|
|
@@ -2452,7 +2746,7 @@ function match(segmentGroup, route, segments) {
|
|
|
2452
2746
|
const matcher = route.matcher || defaultUrlMatcher;
|
|
2453
2747
|
const res = matcher(segments, segmentGroup, route);
|
|
2454
2748
|
if (!res)
|
|
2455
|
-
return Object.assign({}, noMatch);
|
|
2749
|
+
return Object.assign({}, noMatch$1);
|
|
2456
2750
|
const posParams = {};
|
|
2457
2751
|
forEach(res.posParams, (v, k) => {
|
|
2458
2752
|
posParams[k] = v.path;
|
|
@@ -2569,7 +2863,7 @@ function noLeftoversInUrl(segmentGroup, segments, outlet) {
|
|
|
2569
2863
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2570
2864
|
* found in the LICENSE file at https://angular.io/license
|
|
2571
2865
|
*/
|
|
2572
|
-
class NoMatch {
|
|
2866
|
+
class NoMatch$1 {
|
|
2573
2867
|
constructor(segmentGroup) {
|
|
2574
2868
|
this.segmentGroup = segmentGroup || null;
|
|
2575
2869
|
}
|
|
@@ -2579,8 +2873,8 @@ class AbsoluteRedirect {
|
|
|
2579
2873
|
this.urlTree = urlTree;
|
|
2580
2874
|
}
|
|
2581
2875
|
}
|
|
2582
|
-
function noMatch
|
|
2583
|
-
return new Observable((obs) => obs.error(new NoMatch(segmentGroup)));
|
|
2876
|
+
function noMatch(segmentGroup) {
|
|
2877
|
+
return new Observable((obs) => obs.error(new NoMatch$1(segmentGroup)));
|
|
2584
2878
|
}
|
|
2585
2879
|
function absoluteRedirect(newTree) {
|
|
2586
2880
|
return new Observable((obs) => obs.error(new AbsoluteRedirect(newTree)));
|
|
@@ -2596,7 +2890,7 @@ function canLoadFails(route) {
|
|
|
2596
2890
|
*
|
|
2597
2891
|
* Lazy modules are loaded along the way.
|
|
2598
2892
|
*/
|
|
2599
|
-
function applyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config) {
|
|
2893
|
+
function applyRedirects$1(moduleInjector, configLoader, urlSerializer, urlTree, config) {
|
|
2600
2894
|
return new ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config).apply();
|
|
2601
2895
|
}
|
|
2602
2896
|
class ApplyRedirects {
|
|
@@ -2629,7 +2923,7 @@ class ApplyRedirects {
|
|
|
2629
2923
|
// we need to run matching, so we can fetch all lazy-loaded modules
|
|
2630
2924
|
return this.match(e.urlTree);
|
|
2631
2925
|
}
|
|
2632
|
-
if (e instanceof NoMatch) {
|
|
2926
|
+
if (e instanceof NoMatch$1) {
|
|
2633
2927
|
throw this.noMatchError(e);
|
|
2634
2928
|
}
|
|
2635
2929
|
throw e;
|
|
@@ -2641,7 +2935,7 @@ class ApplyRedirects {
|
|
|
2641
2935
|
return this.createUrlTree(squashSegmentGroup(rootSegmentGroup), tree.queryParams, tree.fragment);
|
|
2642
2936
|
}));
|
|
2643
2937
|
return mapped$.pipe(catchError((e) => {
|
|
2644
|
-
if (e instanceof NoMatch) {
|
|
2938
|
+
if (e instanceof NoMatch$1) {
|
|
2645
2939
|
throw this.noMatchError(e);
|
|
2646
2940
|
}
|
|
2647
2941
|
throw e;
|
|
@@ -2694,7 +2988,7 @@ class ApplyRedirects {
|
|
|
2694
2988
|
return from(routes).pipe(concatMap((r) => {
|
|
2695
2989
|
const expanded$ = this.expandSegmentAgainstRoute(ngModule, segmentGroup, routes, r, segments, outlet, allowRedirects);
|
|
2696
2990
|
return expanded$.pipe(catchError((e) => {
|
|
2697
|
-
if (e instanceof NoMatch) {
|
|
2991
|
+
if (e instanceof NoMatch$1) {
|
|
2698
2992
|
return of(null);
|
|
2699
2993
|
}
|
|
2700
2994
|
throw e;
|
|
@@ -2704,14 +2998,14 @@ class ApplyRedirects {
|
|
|
2704
2998
|
if (noLeftoversInUrl(segmentGroup, segments, outlet)) {
|
|
2705
2999
|
return of(new UrlSegmentGroup([], {}));
|
|
2706
3000
|
}
|
|
2707
|
-
throw new NoMatch(segmentGroup);
|
|
3001
|
+
throw new NoMatch$1(segmentGroup);
|
|
2708
3002
|
}
|
|
2709
3003
|
throw e;
|
|
2710
3004
|
}));
|
|
2711
3005
|
}
|
|
2712
3006
|
expandSegmentAgainstRoute(ngModule, segmentGroup, routes, route, paths, outlet, allowRedirects) {
|
|
2713
3007
|
if (!isImmediateMatch(route, segmentGroup, paths, outlet)) {
|
|
2714
|
-
return noMatch
|
|
3008
|
+
return noMatch(segmentGroup);
|
|
2715
3009
|
}
|
|
2716
3010
|
if (route.redirectTo === undefined) {
|
|
2717
3011
|
return this.matchSegmentAgainstRoute(ngModule, segmentGroup, route, paths, outlet);
|
|
@@ -2719,7 +3013,7 @@ class ApplyRedirects {
|
|
|
2719
3013
|
if (allowRedirects && this.allowRedirects) {
|
|
2720
3014
|
return this.expandSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, paths, outlet);
|
|
2721
3015
|
}
|
|
2722
|
-
return noMatch
|
|
3016
|
+
return noMatch(segmentGroup);
|
|
2723
3017
|
}
|
|
2724
3018
|
expandSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet) {
|
|
2725
3019
|
if (route.path === '**') {
|
|
@@ -2740,7 +3034,7 @@ class ApplyRedirects {
|
|
|
2740
3034
|
expandRegularSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet) {
|
|
2741
3035
|
const { matched, consumedSegments, lastChild, positionalParamSegments } = match(segmentGroup, route, segments);
|
|
2742
3036
|
if (!matched)
|
|
2743
|
-
return noMatch
|
|
3037
|
+
return noMatch(segmentGroup);
|
|
2744
3038
|
const newTree = this.applyRedirectCommands(consumedSegments, route.redirectTo, positionalParamSegments);
|
|
2745
3039
|
if (route.redirectTo.startsWith('/')) {
|
|
2746
3040
|
return absoluteRedirect(newTree);
|
|
@@ -2763,7 +3057,7 @@ class ApplyRedirects {
|
|
|
2763
3057
|
}
|
|
2764
3058
|
const { matched, consumedSegments, lastChild } = match(rawSegmentGroup, route, segments);
|
|
2765
3059
|
if (!matched)
|
|
2766
|
-
return noMatch
|
|
3060
|
+
return noMatch(rawSegmentGroup);
|
|
2767
3061
|
const rawSlicedSegments = segments.slice(lastChild);
|
|
2768
3062
|
const childConfig$ = this.getChildConfig(ngModule, route, segments);
|
|
2769
3063
|
return childConfig$.pipe(mergeMap((routerConfig) => {
|
|
@@ -2941,8 +3235,8 @@ function squashSegmentGroup(segmentGroup) {
|
|
|
2941
3235
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2942
3236
|
* found in the LICENSE file at https://angular.io/license
|
|
2943
3237
|
*/
|
|
2944
|
-
function applyRedirects
|
|
2945
|
-
return switchMap(t => applyRedirects(moduleInjector, configLoader, urlSerializer, t.extractedUrl, config)
|
|
3238
|
+
function applyRedirects(moduleInjector, configLoader, urlSerializer, config) {
|
|
3239
|
+
return switchMap(t => applyRedirects$1(moduleInjector, configLoader, urlSerializer, t.extractedUrl, config)
|
|
2946
3240
|
.pipe(map(urlAfterRedirects => (Object.assign(Object.assign({}, t), { urlAfterRedirects })))));
|
|
2947
3241
|
}
|
|
2948
3242
|
|
|
@@ -3234,18 +3528,18 @@ function runCanDeactivate(component, currARS, currRSS, futureRSS, moduleInjector
|
|
|
3234
3528
|
* Use of this source code is governed by an MIT-style license that can be
|
|
3235
3529
|
* found in the LICENSE file at https://angular.io/license
|
|
3236
3530
|
*/
|
|
3237
|
-
class NoMatch
|
|
3531
|
+
class NoMatch {
|
|
3238
3532
|
}
|
|
3239
3533
|
function newObservableError(e) {
|
|
3240
3534
|
// TODO(atscott): This pattern is used throughout the router code and can be `throwError` instead.
|
|
3241
3535
|
return new Observable((obs) => obs.error(e));
|
|
3242
3536
|
}
|
|
3243
|
-
function recognize(rootComponentType, config, urlTree, url, paramsInheritanceStrategy = 'emptyOnly', relativeLinkResolution = 'legacy') {
|
|
3537
|
+
function recognize$1(rootComponentType, config, urlTree, url, paramsInheritanceStrategy = 'emptyOnly', relativeLinkResolution = 'legacy') {
|
|
3244
3538
|
try {
|
|
3245
3539
|
const result = new Recognizer(rootComponentType, config, urlTree, url, paramsInheritanceStrategy, relativeLinkResolution)
|
|
3246
3540
|
.recognize();
|
|
3247
3541
|
if (result === null) {
|
|
3248
|
-
return newObservableError(new NoMatch
|
|
3542
|
+
return newObservableError(new NoMatch());
|
|
3249
3543
|
}
|
|
3250
3544
|
else {
|
|
3251
3545
|
return of(result);
|
|
@@ -3489,8 +3783,8 @@ function getResolve(route) {
|
|
|
3489
3783
|
* Use of this source code is governed by an MIT-style license that can be
|
|
3490
3784
|
* found in the LICENSE file at https://angular.io/license
|
|
3491
3785
|
*/
|
|
3492
|
-
function recognize
|
|
3493
|
-
return mergeMap(t => recognize(rootComponentType, config, t.urlAfterRedirects, serializer(t.urlAfterRedirects), paramsInheritanceStrategy, relativeLinkResolution)
|
|
3786
|
+
function recognize(rootComponentType, config, serializer, paramsInheritanceStrategy, relativeLinkResolution) {
|
|
3787
|
+
return mergeMap(t => recognize$1(rootComponentType, config, t.urlAfterRedirects, serializer(t.urlAfterRedirects), paramsInheritanceStrategy, relativeLinkResolution)
|
|
3494
3788
|
.pipe(map(targetSnapshot => (Object.assign(Object.assign({}, t), { targetSnapshot })))));
|
|
3495
3789
|
}
|
|
3496
3790
|
|
|
@@ -3652,8 +3946,8 @@ class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {
|
|
|
3652
3946
|
*/
|
|
3653
3947
|
const ROUTES = new InjectionToken('ROUTES');
|
|
3654
3948
|
class RouterConfigLoader {
|
|
3655
|
-
constructor(
|
|
3656
|
-
this.
|
|
3949
|
+
constructor(injector, compiler, onLoadStartListener, onLoadEndListener) {
|
|
3950
|
+
this.injector = injector;
|
|
3657
3951
|
this.compiler = compiler;
|
|
3658
3952
|
this.onLoadStartListener = onLoadStartListener;
|
|
3659
3953
|
this.onLoadEndListener = onLoadEndListener;
|
|
@@ -3687,92 +3981,14 @@ class RouterConfigLoader {
|
|
|
3687
3981
|
return route._loader$;
|
|
3688
3982
|
}
|
|
3689
3983
|
loadModuleFactory(loadChildren) {
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
else {
|
|
3699
|
-
return from(this.compiler.compileModuleAsync(t));
|
|
3700
|
-
}
|
|
3701
|
-
}));
|
|
3702
|
-
}
|
|
3703
|
-
}
|
|
3704
|
-
}
|
|
3705
|
-
|
|
3706
|
-
/**
|
|
3707
|
-
* @license
|
|
3708
|
-
* Copyright Google LLC All Rights Reserved.
|
|
3709
|
-
*
|
|
3710
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
3711
|
-
* found in the LICENSE file at https://angular.io/license
|
|
3712
|
-
*/
|
|
3713
|
-
/**
|
|
3714
|
-
* Store contextual information about a `RouterOutlet`
|
|
3715
|
-
*
|
|
3716
|
-
* @publicApi
|
|
3717
|
-
*/
|
|
3718
|
-
class OutletContext {
|
|
3719
|
-
constructor() {
|
|
3720
|
-
this.outlet = null;
|
|
3721
|
-
this.route = null;
|
|
3722
|
-
this.resolver = null;
|
|
3723
|
-
this.children = new ChildrenOutletContexts();
|
|
3724
|
-
this.attachRef = null;
|
|
3725
|
-
}
|
|
3726
|
-
}
|
|
3727
|
-
/**
|
|
3728
|
-
* Store contextual information about the children (= nested) `RouterOutlet`
|
|
3729
|
-
*
|
|
3730
|
-
* @publicApi
|
|
3731
|
-
*/
|
|
3732
|
-
class ChildrenOutletContexts {
|
|
3733
|
-
constructor() {
|
|
3734
|
-
// contexts for child outlets, by name.
|
|
3735
|
-
this.contexts = new Map();
|
|
3736
|
-
}
|
|
3737
|
-
/** Called when a `RouterOutlet` directive is instantiated */
|
|
3738
|
-
onChildOutletCreated(childName, outlet) {
|
|
3739
|
-
const context = this.getOrCreateContext(childName);
|
|
3740
|
-
context.outlet = outlet;
|
|
3741
|
-
this.contexts.set(childName, context);
|
|
3742
|
-
}
|
|
3743
|
-
/**
|
|
3744
|
-
* Called when a `RouterOutlet` directive is destroyed.
|
|
3745
|
-
* We need to keep the context as the outlet could be destroyed inside a NgIf and might be
|
|
3746
|
-
* re-created later.
|
|
3747
|
-
*/
|
|
3748
|
-
onChildOutletDestroyed(childName) {
|
|
3749
|
-
const context = this.getContext(childName);
|
|
3750
|
-
if (context) {
|
|
3751
|
-
context.outlet = null;
|
|
3752
|
-
}
|
|
3753
|
-
}
|
|
3754
|
-
/**
|
|
3755
|
-
* Called when the corresponding route is deactivated during navigation.
|
|
3756
|
-
* Because the component get destroyed, all children outlet are destroyed.
|
|
3757
|
-
*/
|
|
3758
|
-
onOutletDeactivated() {
|
|
3759
|
-
const contexts = this.contexts;
|
|
3760
|
-
this.contexts = new Map();
|
|
3761
|
-
return contexts;
|
|
3762
|
-
}
|
|
3763
|
-
onOutletReAttached(contexts) {
|
|
3764
|
-
this.contexts = contexts;
|
|
3765
|
-
}
|
|
3766
|
-
getOrCreateContext(childName) {
|
|
3767
|
-
let context = this.getContext(childName);
|
|
3768
|
-
if (!context) {
|
|
3769
|
-
context = new OutletContext();
|
|
3770
|
-
this.contexts.set(childName, context);
|
|
3771
|
-
}
|
|
3772
|
-
return context;
|
|
3773
|
-
}
|
|
3774
|
-
getContext(childName) {
|
|
3775
|
-
return this.contexts.get(childName) || null;
|
|
3984
|
+
return wrapIntoObservable(loadChildren()).pipe(mergeMap((t) => {
|
|
3985
|
+
if (t instanceof NgModuleFactory) {
|
|
3986
|
+
return of(t);
|
|
3987
|
+
}
|
|
3988
|
+
else {
|
|
3989
|
+
return from(this.compiler.compileModuleAsync(t));
|
|
3990
|
+
}
|
|
3991
|
+
}));
|
|
3776
3992
|
}
|
|
3777
3993
|
}
|
|
3778
3994
|
|
|
@@ -3805,15 +4021,8 @@ class DefaultUrlHandlingStrategy {
|
|
|
3805
4021
|
merge(newUrlPart, wholeUrl) {
|
|
3806
4022
|
return newUrlPart;
|
|
3807
4023
|
}
|
|
3808
|
-
}
|
|
3809
|
-
|
|
3810
|
-
/**
|
|
3811
|
-
* @license
|
|
3812
|
-
* Copyright Google LLC All Rights Reserved.
|
|
3813
|
-
*
|
|
3814
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
3815
|
-
* found in the LICENSE file at https://angular.io/license
|
|
3816
|
-
*/
|
|
4024
|
+
}
|
|
4025
|
+
|
|
3817
4026
|
function defaultErrorHandler(error) {
|
|
3818
4027
|
throw error;
|
|
3819
4028
|
}
|
|
@@ -3827,7 +4036,7 @@ function defaultRouterHook(snapshot, runExtras) {
|
|
|
3827
4036
|
return of(null);
|
|
3828
4037
|
}
|
|
3829
4038
|
/**
|
|
3830
|
-
* The equivalent `
|
|
4039
|
+
* The equivalent `IsActiveMatchOptions` options for `Router.isActive` is called with `true`
|
|
3831
4040
|
* (exact = true).
|
|
3832
4041
|
*/
|
|
3833
4042
|
const exactMatchOptions = {
|
|
@@ -3837,7 +4046,7 @@ const exactMatchOptions = {
|
|
|
3837
4046
|
queryParams: 'exact'
|
|
3838
4047
|
};
|
|
3839
4048
|
/**
|
|
3840
|
-
* The equivalent `
|
|
4049
|
+
* The equivalent `IsActiveMatchOptions` options for `Router.isActive` is called with `false`
|
|
3841
4050
|
* (exact = false).
|
|
3842
4051
|
*/
|
|
3843
4052
|
const subsetMatchOptions = {
|
|
@@ -3863,7 +4072,7 @@ class Router {
|
|
|
3863
4072
|
* Creates the router service.
|
|
3864
4073
|
*/
|
|
3865
4074
|
// TODO: vsavkin make internal after the final is out.
|
|
3866
|
-
constructor(rootComponentType, urlSerializer, rootContexts, location, injector,
|
|
4075
|
+
constructor(rootComponentType, urlSerializer, rootContexts, location, injector, compiler, config) {
|
|
3867
4076
|
this.rootComponentType = rootComponentType;
|
|
3868
4077
|
this.urlSerializer = urlSerializer;
|
|
3869
4078
|
this.rootContexts = rootContexts;
|
|
@@ -3872,11 +4081,6 @@ class Router {
|
|
|
3872
4081
|
this.lastSuccessfulNavigation = null;
|
|
3873
4082
|
this.currentNavigation = null;
|
|
3874
4083
|
this.disposed = false;
|
|
3875
|
-
/**
|
|
3876
|
-
* Tracks the previously seen location change from the location subscription so we can compare
|
|
3877
|
-
* the two latest to see if they are duplicates. See setUpLocationChangeListener.
|
|
3878
|
-
*/
|
|
3879
|
-
this.lastLocationChangeInfo = null;
|
|
3880
4084
|
this.navigationId = 0;
|
|
3881
4085
|
/**
|
|
3882
4086
|
* The id of the currently active page in the router.
|
|
@@ -3967,19 +4171,24 @@ class Router {
|
|
|
3967
4171
|
* Configures how the Router attempts to restore state when a navigation is cancelled.
|
|
3968
4172
|
*
|
|
3969
4173
|
* 'replace' - Always uses `location.replaceState` to set the browser state to the state of the
|
|
3970
|
-
* router before the navigation started.
|
|
4174
|
+
* router before the navigation started. This means that if the URL of the browser is updated
|
|
4175
|
+
* _before_ the navigation is canceled, the Router will simply replace the item in history rather
|
|
4176
|
+
* than trying to restore to the previous location in the session history. This happens most
|
|
4177
|
+
* frequently with `urlUpdateStrategy: 'eager'` and navigations with the browser back/forward
|
|
4178
|
+
* buttons.
|
|
3971
4179
|
*
|
|
3972
|
-
* 'computed' - Will
|
|
3973
|
-
* when the navigation gets cancelled
|
|
4180
|
+
* 'computed' - Will attempt to return to the same index in the session history that corresponds
|
|
4181
|
+
* to the Angular route when the navigation gets cancelled. For example, if the browser back
|
|
4182
|
+
* button is clicked and the navigation is cancelled, the Router will trigger a forward navigation
|
|
4183
|
+
* and vice versa.
|
|
3974
4184
|
*
|
|
3975
|
-
*
|
|
4185
|
+
* Note: the 'computed' option is incompatible with any `UrlHandlingStrategy` which only
|
|
4186
|
+
* handles a portion of the URL because the history restoration navigates to the previous place in
|
|
4187
|
+
* the browser history rather than simply resetting a portion of the URL.
|
|
4188
|
+
*
|
|
4189
|
+
* The default value is `replace`.
|
|
3976
4190
|
*
|
|
3977
|
-
* @internal
|
|
3978
4191
|
*/
|
|
3979
|
-
// TODO(atscott): Determine how/when/if to make this public API
|
|
3980
|
-
// This shouldn’t be an option at all but may need to be in order to allow migration without a
|
|
3981
|
-
// breaking change. We need to determine if it should be made into public api (or if we forgo
|
|
3982
|
-
// the option and release as a breaking change bug fix in a major version).
|
|
3983
4192
|
this.canceledNavigationResolution = 'replace';
|
|
3984
4193
|
const onLoadStart = (r) => this.triggerEvent(new RouteConfigLoadStart(r));
|
|
3985
4194
|
const onLoadEnd = (r) => this.triggerEvent(new RouteConfigLoadEnd(r));
|
|
@@ -3991,7 +4200,7 @@ class Router {
|
|
|
3991
4200
|
this.currentUrlTree = createEmptyUrlTree();
|
|
3992
4201
|
this.rawUrlTree = this.currentUrlTree;
|
|
3993
4202
|
this.browserUrlTree = this.currentUrlTree;
|
|
3994
|
-
this.configLoader = new RouterConfigLoader(
|
|
4203
|
+
this.configLoader = new RouterConfigLoader(injector, compiler, onLoadStart, onLoadEnd);
|
|
3995
4204
|
this.routerState = createEmptyState(this.currentUrlTree, this.rootComponentType);
|
|
3996
4205
|
this.transitions = new BehaviorSubject({
|
|
3997
4206
|
id: 0,
|
|
@@ -4048,11 +4257,22 @@ class Router {
|
|
|
4048
4257
|
null
|
|
4049
4258
|
};
|
|
4050
4259
|
}), switchMap(t => {
|
|
4260
|
+
const browserUrlTree = this.browserUrlTree.toString();
|
|
4051
4261
|
const urlTransition = !this.navigated ||
|
|
4052
|
-
t.extractedUrl.toString() !==
|
|
4262
|
+
t.extractedUrl.toString() !== browserUrlTree ||
|
|
4263
|
+
// Navigations which succeed or ones which fail and are cleaned up
|
|
4264
|
+
// correctly should result in `browserUrlTree` and `currentUrlTree`
|
|
4265
|
+
// matching. If this is not the case, assume something went wrong and try
|
|
4266
|
+
// processing the URL again.
|
|
4267
|
+
browserUrlTree !== this.currentUrlTree.toString();
|
|
4053
4268
|
const processCurrentUrl = (this.onSameUrlNavigation === 'reload' ? true : urlTransition) &&
|
|
4054
4269
|
this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl);
|
|
4055
4270
|
if (processCurrentUrl) {
|
|
4271
|
+
// If the source of the navigation is from a browser event, the URL is
|
|
4272
|
+
// already updated. We already need to sync the internal state.
|
|
4273
|
+
if (isBrowserTriggeredNavigation(t.source)) {
|
|
4274
|
+
this.browserUrlTree = t.extractedUrl;
|
|
4275
|
+
}
|
|
4056
4276
|
return of(t).pipe(
|
|
4057
4277
|
// Fire NavigationStart event
|
|
4058
4278
|
switchMap(t => {
|
|
@@ -4066,18 +4286,20 @@ class Router {
|
|
|
4066
4286
|
return Promise.resolve(t);
|
|
4067
4287
|
}),
|
|
4068
4288
|
// ApplyRedirects
|
|
4069
|
-
applyRedirects
|
|
4289
|
+
applyRedirects(this.ngModule.injector, this.configLoader, this.urlSerializer, this.config),
|
|
4070
4290
|
// Update the currentNavigation
|
|
4291
|
+
// `urlAfterRedirects` is guaranteed to be set after this point
|
|
4071
4292
|
tap(t => {
|
|
4072
4293
|
this.currentNavigation = Object.assign(Object.assign({}, this.currentNavigation), { finalUrl: t.urlAfterRedirects });
|
|
4073
4294
|
}),
|
|
4074
4295
|
// Recognize
|
|
4075
|
-
recognize
|
|
4296
|
+
recognize(this.rootComponentType, this.config, (url) => this.serializeUrl(url), this.paramsInheritanceStrategy, this.relativeLinkResolution),
|
|
4076
4297
|
// Update URL if in `eager` update mode
|
|
4077
4298
|
tap(t => {
|
|
4078
4299
|
if (this.urlUpdateStrategy === 'eager') {
|
|
4079
4300
|
if (!t.extras.skipLocationChange) {
|
|
4080
|
-
this.
|
|
4301
|
+
const rawUrl = this.urlHandlingStrategy.merge(t.urlAfterRedirects, t.rawUrl);
|
|
4302
|
+
this.setBrowserUrl(rawUrl, t);
|
|
4081
4303
|
}
|
|
4082
4304
|
this.browserUrlTree = t.urlAfterRedirects;
|
|
4083
4305
|
}
|
|
@@ -4106,7 +4328,6 @@ class Router {
|
|
|
4106
4328
|
* in the browser.
|
|
4107
4329
|
*/
|
|
4108
4330
|
this.rawUrlTree = t.rawUrl;
|
|
4109
|
-
this.browserUrlTree = t.urlAfterRedirects;
|
|
4110
4331
|
t.resolve(null);
|
|
4111
4332
|
return EMPTY;
|
|
4112
4333
|
}
|
|
@@ -4189,7 +4410,7 @@ class Router {
|
|
|
4189
4410
|
tap((t) => {
|
|
4190
4411
|
this.currentUrlTree = t.urlAfterRedirects;
|
|
4191
4412
|
this.rawUrlTree =
|
|
4192
|
-
this.urlHandlingStrategy.merge(
|
|
4413
|
+
this.urlHandlingStrategy.merge(t.urlAfterRedirects, t.rawUrl);
|
|
4193
4414
|
this.routerState = t.targetRouterState;
|
|
4194
4415
|
if (this.urlUpdateStrategy === 'deferred') {
|
|
4195
4416
|
if (!t.extras.skipLocationChange) {
|
|
@@ -4214,28 +4435,7 @@ class Router {
|
|
|
4214
4435
|
* means. */
|
|
4215
4436
|
if (!completed && !errored) {
|
|
4216
4437
|
const cancelationReason = `Navigation ID ${t.id} is not equal to the current navigation id ${this.navigationId}`;
|
|
4217
|
-
|
|
4218
|
-
// Must reset to current URL tree here to ensure history.state is set. On
|
|
4219
|
-
// a fresh page load, if a new navigation comes in before a successful
|
|
4220
|
-
// navigation completes, there will be nothing in
|
|
4221
|
-
// history.state.navigationId. This can cause sync problems with
|
|
4222
|
-
// AngularJS sync code which looks for a value here in order to determine
|
|
4223
|
-
// whether or not to handle a given popstate event or to leave it to the
|
|
4224
|
-
// Angular router.
|
|
4225
|
-
this.restoreHistory(t);
|
|
4226
|
-
this.cancelNavigationTransition(t, cancelationReason);
|
|
4227
|
-
}
|
|
4228
|
-
else {
|
|
4229
|
-
// We cannot trigger a `location.historyGo` if the
|
|
4230
|
-
// cancellation was due to a new navigation before the previous could
|
|
4231
|
-
// complete. This is because `location.historyGo` triggers a `popstate`
|
|
4232
|
-
// which would also trigger another navigation. Instead, treat this as a
|
|
4233
|
-
// redirect and do not reset the state.
|
|
4234
|
-
this.cancelNavigationTransition(t, cancelationReason);
|
|
4235
|
-
// TODO(atscott): The same problem happens here with a fresh page load
|
|
4236
|
-
// and a new navigation before that completes where we won't set a page
|
|
4237
|
-
// id.
|
|
4238
|
-
}
|
|
4438
|
+
this.cancelNavigationTransition(t, cancelationReason);
|
|
4239
4439
|
}
|
|
4240
4440
|
// currentNavigation should always be reset to null here. If navigation was
|
|
4241
4441
|
// successful, lastSuccessfulTransition will have already been set. Therefore
|
|
@@ -4265,7 +4465,7 @@ class Router {
|
|
|
4265
4465
|
// This is only applicable with initial navigation, so setting
|
|
4266
4466
|
// `navigated` only when not redirecting resolves this scenario.
|
|
4267
4467
|
this.navigated = true;
|
|
4268
|
-
this.restoreHistory(t
|
|
4468
|
+
this.restoreHistory(t);
|
|
4269
4469
|
}
|
|
4270
4470
|
const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), e.message);
|
|
4271
4471
|
eventsSubject.next(navCancel);
|
|
@@ -4283,7 +4483,12 @@ class Router {
|
|
|
4283
4483
|
const mergedTree = this.urlHandlingStrategy.merge(e.url, this.rawUrlTree);
|
|
4284
4484
|
const extras = {
|
|
4285
4485
|
skipLocationChange: t.extras.skipLocationChange,
|
|
4286
|
-
|
|
4486
|
+
// The URL is already updated at this point if we have 'eager' URL
|
|
4487
|
+
// updates or if the navigation was triggered by the browser (back
|
|
4488
|
+
// button, URL bar, etc). We want to replace that item in history if
|
|
4489
|
+
// the navigation is rejected.
|
|
4490
|
+
replaceUrl: this.urlUpdateStrategy === 'eager' ||
|
|
4491
|
+
isBrowserTriggeredNavigation(t.source)
|
|
4287
4492
|
};
|
|
4288
4493
|
this.scheduleNavigation(mergedTree, 'imperative', null, extras, { resolve: t.resolve, reject: t.reject, promise: t.promise });
|
|
4289
4494
|
}, 0);
|
|
@@ -4292,7 +4497,7 @@ class Router {
|
|
|
4292
4497
|
* the pre-error state. */
|
|
4293
4498
|
}
|
|
4294
4499
|
else {
|
|
4295
|
-
this.restoreHistory(t
|
|
4500
|
+
this.restoreHistory(t);
|
|
4296
4501
|
const navError = new NavigationError(t.id, this.serializeUrl(t.extractedUrl), e);
|
|
4297
4502
|
eventsSubject.next(navError);
|
|
4298
4503
|
try {
|
|
@@ -4317,16 +4522,8 @@ class Router {
|
|
|
4317
4522
|
// this will simplify the lifecycle of the router.
|
|
4318
4523
|
this.routerState.root.component = this.rootComponentType;
|
|
4319
4524
|
}
|
|
4320
|
-
getTransition() {
|
|
4321
|
-
const transition = this.transitions.value;
|
|
4322
|
-
// This value needs to be set. Other values such as extractedUrl are set on initial navigation
|
|
4323
|
-
// but the urlAfterRedirects may not get set if we aren't processing the new URL *and* not
|
|
4324
|
-
// processing the previous URL.
|
|
4325
|
-
transition.urlAfterRedirects = this.browserUrlTree;
|
|
4326
|
-
return transition;
|
|
4327
|
-
}
|
|
4328
4525
|
setTransition(t) {
|
|
4329
|
-
this.transitions.next(Object.assign(Object.assign({}, this.
|
|
4526
|
+
this.transitions.next(Object.assign(Object.assign({}, this.transitions.value), t));
|
|
4330
4527
|
}
|
|
4331
4528
|
/**
|
|
4332
4529
|
* Sets up the location change listener and performs the initial navigation.
|
|
@@ -4348,13 +4545,16 @@ class Router {
|
|
|
4348
4545
|
// run into ngZone
|
|
4349
4546
|
if (!this.locationSubscription) {
|
|
4350
4547
|
this.locationSubscription = this.location.subscribe(event => {
|
|
4351
|
-
const
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4548
|
+
const source = event['type'] === 'popstate' ? 'popstate' : 'hashchange';
|
|
4549
|
+
if (source === 'popstate') {
|
|
4550
|
+
// The `setTimeout` was added in #12160 and is likely to support Angular/AngularJS
|
|
4551
|
+
// hybrid apps.
|
|
4355
4552
|
setTimeout(() => {
|
|
4356
|
-
|
|
4553
|
+
var _a;
|
|
4357
4554
|
const extras = { replaceUrl: true };
|
|
4555
|
+
// Navigations coming from Angular router have a navigationId state
|
|
4556
|
+
// property. When this exists, restore the state.
|
|
4557
|
+
const state = ((_a = event.state) === null || _a === void 0 ? void 0 : _a.navigationId) ? event.state : null;
|
|
4358
4558
|
if (state) {
|
|
4359
4559
|
const stateCopy = Object.assign({}, state);
|
|
4360
4560
|
delete stateCopy.navigationId;
|
|
@@ -4363,45 +4563,13 @@ class Router {
|
|
|
4363
4563
|
extras.state = stateCopy;
|
|
4364
4564
|
}
|
|
4365
4565
|
}
|
|
4566
|
+
const urlTree = this.parseUrl(event['url']);
|
|
4366
4567
|
this.scheduleNavigation(urlTree, source, state, extras);
|
|
4367
4568
|
}, 0);
|
|
4368
4569
|
}
|
|
4369
|
-
this.lastLocationChangeInfo = currentChange;
|
|
4370
4570
|
});
|
|
4371
4571
|
}
|
|
4372
4572
|
}
|
|
4373
|
-
/** Extracts router-related information from a `PopStateEvent`. */
|
|
4374
|
-
extractLocationChangeInfoFromEvent(change) {
|
|
4375
|
-
var _a;
|
|
4376
|
-
return {
|
|
4377
|
-
source: change['type'] === 'popstate' ? 'popstate' : 'hashchange',
|
|
4378
|
-
urlTree: this.parseUrl(change['url']),
|
|
4379
|
-
// Navigations coming from Angular router have a navigationId state
|
|
4380
|
-
// property. When this exists, restore the state.
|
|
4381
|
-
state: ((_a = change.state) === null || _a === void 0 ? void 0 : _a.navigationId) ? change.state : null,
|
|
4382
|
-
transitionId: this.getTransition().id
|
|
4383
|
-
};
|
|
4384
|
-
}
|
|
4385
|
-
/**
|
|
4386
|
-
* Determines whether two events triggered by the Location subscription are due to the same
|
|
4387
|
-
* navigation. The location subscription can fire two events (popstate and hashchange) for a
|
|
4388
|
-
* single navigation. The second one should be ignored, that is, we should not schedule another
|
|
4389
|
-
* navigation in the Router.
|
|
4390
|
-
*/
|
|
4391
|
-
shouldScheduleNavigation(previous, current) {
|
|
4392
|
-
if (!previous)
|
|
4393
|
-
return true;
|
|
4394
|
-
const sameDestination = current.urlTree.toString() === previous.urlTree.toString();
|
|
4395
|
-
const eventsOccurredAtSameTime = current.transitionId === previous.transitionId;
|
|
4396
|
-
if (!eventsOccurredAtSameTime || !sameDestination) {
|
|
4397
|
-
return true;
|
|
4398
|
-
}
|
|
4399
|
-
if ((current.source === 'hashchange' && previous.source === 'popstate') ||
|
|
4400
|
-
(current.source === 'popstate' && previous.source === 'hashchange')) {
|
|
4401
|
-
return false;
|
|
4402
|
-
}
|
|
4403
|
-
return true;
|
|
4404
|
-
}
|
|
4405
4573
|
/** The current URL. */
|
|
4406
4574
|
get url() {
|
|
4407
4575
|
return this.serializeUrl(this.currentUrlTree);
|
|
@@ -4640,33 +4808,32 @@ class Router {
|
|
|
4640
4808
|
this.lastSuccessfulNavigation = this.currentNavigation;
|
|
4641
4809
|
t.resolve(true);
|
|
4642
4810
|
}, e => {
|
|
4643
|
-
this.console.warn(`Unhandled Navigation Error: `);
|
|
4811
|
+
this.console.warn(`Unhandled Navigation Error: ${e}`);
|
|
4644
4812
|
});
|
|
4645
4813
|
}
|
|
4646
4814
|
scheduleNavigation(rawUrl, source, restoredState, extras, priorPromise) {
|
|
4647
|
-
var _a, _b;
|
|
4815
|
+
var _a, _b, _c;
|
|
4648
4816
|
if (this.disposed) {
|
|
4649
4817
|
return Promise.resolve(false);
|
|
4650
4818
|
}
|
|
4651
|
-
// *
|
|
4652
|
-
//
|
|
4653
|
-
// navs. Duplicates may also be triggered by attempts to sync AngularJS and Angular router
|
|
4654
|
-
// states.
|
|
4819
|
+
// * Duplicate navigations may also be triggered by attempts to sync AngularJS and Angular
|
|
4820
|
+
// router states.
|
|
4655
4821
|
// * Imperative navigations can be cancelled by router guards, meaning the URL won't change. If
|
|
4656
4822
|
// the user follows that with a navigation using the back/forward button or manual URL change,
|
|
4657
4823
|
// the destination may be the same as the previous imperative attempt. We should not skip
|
|
4658
4824
|
// these navigations because it's a separate case from the one above -- it's not a duplicate
|
|
4659
4825
|
// navigation.
|
|
4660
|
-
const lastNavigation = this.
|
|
4826
|
+
const lastNavigation = this.transitions.value;
|
|
4661
4827
|
// We don't want to skip duplicate successful navs if they're imperative because
|
|
4662
4828
|
// onSameUrlNavigation could be 'reload' (so the duplicate is intended).
|
|
4663
|
-
const browserNavPrecededByRouterNav = source
|
|
4829
|
+
const browserNavPrecededByRouterNav = isBrowserTriggeredNavigation(source) && lastNavigation &&
|
|
4830
|
+
!isBrowserTriggeredNavigation(lastNavigation.source);
|
|
4664
4831
|
const lastNavigationSucceeded = this.lastSuccessfulId === lastNavigation.id;
|
|
4665
4832
|
// If the last navigation succeeded or is in flight, we can use the rawUrl as the comparison.
|
|
4666
4833
|
// However, if it failed, we should compare to the final result (urlAfterRedirects).
|
|
4667
4834
|
const lastNavigationUrl = (lastNavigationSucceeded || this.currentNavigation) ?
|
|
4668
4835
|
lastNavigation.rawUrl :
|
|
4669
|
-
lastNavigation.urlAfterRedirects;
|
|
4836
|
+
((_a = lastNavigation.urlAfterRedirects) !== null && _a !== void 0 ? _a : this.browserUrlTree);
|
|
4670
4837
|
const duplicateNav = lastNavigationUrl.toString() === rawUrl.toString();
|
|
4671
4838
|
if (browserNavPrecededByRouterNav && duplicateNav) {
|
|
4672
4839
|
return Promise.resolve(true); // return value is not used
|
|
@@ -4702,10 +4869,10 @@ class Router {
|
|
|
4702
4869
|
// If we're replacing the URL or doing a silent navigation, we do not want to increment the
|
|
4703
4870
|
// page id because we aren't pushing a new entry to history.
|
|
4704
4871
|
if (extras.replaceUrl || extras.skipLocationChange) {
|
|
4705
|
-
targetPageId = (
|
|
4872
|
+
targetPageId = (_b = this.browserPageId) !== null && _b !== void 0 ? _b : 0;
|
|
4706
4873
|
}
|
|
4707
4874
|
else {
|
|
4708
|
-
targetPageId = ((
|
|
4875
|
+
targetPageId = ((_c = this.browserPageId) !== null && _c !== void 0 ? _c : 0) + 1;
|
|
4709
4876
|
}
|
|
4710
4877
|
}
|
|
4711
4878
|
}
|
|
@@ -4748,7 +4915,7 @@ class Router {
|
|
|
4748
4915
|
* Performs the necessary rollback action to restore the browser URL to the
|
|
4749
4916
|
* state before the transition.
|
|
4750
4917
|
*/
|
|
4751
|
-
restoreHistory(t
|
|
4918
|
+
restoreHistory(t) {
|
|
4752
4919
|
var _a, _b;
|
|
4753
4920
|
if (this.canceledNavigationResolution === 'computed') {
|
|
4754
4921
|
const targetPagePosition = this.currentPageId - t.targetPageId;
|
|
@@ -4770,7 +4937,6 @@ class Router {
|
|
|
4770
4937
|
// TODO(atscott): resetting the `browserUrlTree` should really be done in `resetState`.
|
|
4771
4938
|
// Investigate if this can be done by running TGP.
|
|
4772
4939
|
this.browserUrlTree = t.currentUrlTree;
|
|
4773
|
-
this.resetUrlToCurrentUrlTree();
|
|
4774
4940
|
}
|
|
4775
4941
|
else {
|
|
4776
4942
|
// The browser URL and router state was not updated before the navigation cancelled so
|
|
@@ -4778,20 +4944,19 @@ class Router {
|
|
|
4778
4944
|
}
|
|
4779
4945
|
}
|
|
4780
4946
|
else if (this.canceledNavigationResolution === 'replace') {
|
|
4781
|
-
|
|
4782
|
-
// for `deferred` navigations that haven't change the internal state yet because guards
|
|
4783
|
-
// reject. For 'eager' navigations, it seems like we also really should reset the state
|
|
4784
|
-
// because the navigation was cancelled. Investigate if this can be done by running TGP.
|
|
4785
|
-
if (restoringFromCaughtError) {
|
|
4786
|
-
this.resetState(t);
|
|
4787
|
-
}
|
|
4788
|
-
this.resetUrlToCurrentUrlTree();
|
|
4947
|
+
this.resetState(t);
|
|
4789
4948
|
}
|
|
4790
4949
|
}
|
|
4791
4950
|
resetState(t) {
|
|
4792
4951
|
this.routerState = t.currentRouterState;
|
|
4793
4952
|
this.currentUrlTree = t.currentUrlTree;
|
|
4953
|
+
// Note here that we use the urlHandlingStrategy to get the reset `rawUrlTree` because it may be
|
|
4954
|
+
// configured to handle only part of the navigation URL. This means we would only want to reset
|
|
4955
|
+
// the part of the navigation handled by the Angular router rather than the whole URL. In
|
|
4956
|
+
// addition, the URLHandlingStrategy may be configured to specifically preserve parts of the URL
|
|
4957
|
+
// when merging, such as the query params so they are not lost on a refresh.
|
|
4794
4958
|
this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, t.rawUrl);
|
|
4959
|
+
this.resetUrlToCurrentUrlTree();
|
|
4795
4960
|
}
|
|
4796
4961
|
resetUrlToCurrentUrlTree() {
|
|
4797
4962
|
this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree), '', this.generateNgRouterState(this.lastSuccessfulId, this.currentPageId));
|
|
@@ -4808,19 +4973,11 @@ class Router {
|
|
|
4808
4973
|
return { navigationId };
|
|
4809
4974
|
}
|
|
4810
4975
|
}
|
|
4811
|
-
Router
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
{ type: UrlSerializer },
|
|
4817
|
-
{ type: ChildrenOutletContexts },
|
|
4818
|
-
{ type: Location },
|
|
4819
|
-
{ type: Injector },
|
|
4820
|
-
{ type: NgModuleFactoryLoader },
|
|
4821
|
-
{ type: Compiler },
|
|
4822
|
-
{ type: undefined }
|
|
4823
|
-
];
|
|
4976
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
4977
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: Router });
|
|
4978
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: Router, decorators: [{
|
|
4979
|
+
type: Injectable
|
|
4980
|
+
}], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
|
|
4824
4981
|
function validateCommands(commands) {
|
|
4825
4982
|
for (let i = 0; i < commands.length; i++) {
|
|
4826
4983
|
const cmd = commands[i];
|
|
@@ -4829,14 +4986,10 @@ function validateCommands(commands) {
|
|
|
4829
4986
|
}
|
|
4830
4987
|
}
|
|
4831
4988
|
}
|
|
4989
|
+
function isBrowserTriggeredNavigation(source) {
|
|
4990
|
+
return source !== 'imperative';
|
|
4991
|
+
}
|
|
4832
4992
|
|
|
4833
|
-
/**
|
|
4834
|
-
* @license
|
|
4835
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4836
|
-
*
|
|
4837
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
4838
|
-
* found in the LICENSE file at https://angular.io/license
|
|
4839
|
-
*/
|
|
4840
4993
|
/**
|
|
4841
4994
|
* @description
|
|
4842
4995
|
*
|
|
@@ -4935,14 +5088,32 @@ function validateCommands(commands) {
|
|
|
4935
5088
|
* @publicApi
|
|
4936
5089
|
*/
|
|
4937
5090
|
class RouterLink {
|
|
4938
|
-
constructor(router, route,
|
|
5091
|
+
constructor(router, route, tabIndexAttribute, renderer, el) {
|
|
4939
5092
|
this.router = router;
|
|
4940
5093
|
this.route = route;
|
|
4941
|
-
this.
|
|
5094
|
+
this.tabIndexAttribute = tabIndexAttribute;
|
|
5095
|
+
this.renderer = renderer;
|
|
5096
|
+
this.el = el;
|
|
5097
|
+
this.commands = null;
|
|
4942
5098
|
/** @internal */
|
|
4943
5099
|
this.onChanges = new Subject();
|
|
4944
|
-
|
|
4945
|
-
|
|
5100
|
+
this.setTabIndexIfNotOnNativeEl('0');
|
|
5101
|
+
}
|
|
5102
|
+
/**
|
|
5103
|
+
* Modifies the tab index if there was not a tabindex attribute on the element during
|
|
5104
|
+
* instantiation.
|
|
5105
|
+
*/
|
|
5106
|
+
setTabIndexIfNotOnNativeEl(newTabIndex) {
|
|
5107
|
+
if (this.tabIndexAttribute != null /* both `null` and `undefined` */) {
|
|
5108
|
+
return;
|
|
5109
|
+
}
|
|
5110
|
+
const renderer = this.renderer;
|
|
5111
|
+
const nativeElement = this.el.nativeElement;
|
|
5112
|
+
if (newTabIndex !== null) {
|
|
5113
|
+
renderer.setAttribute(nativeElement, 'tabindex', newTabIndex);
|
|
5114
|
+
}
|
|
5115
|
+
else {
|
|
5116
|
+
renderer.removeAttribute(nativeElement, 'tabindex');
|
|
4946
5117
|
}
|
|
4947
5118
|
}
|
|
4948
5119
|
/** @nodoc */
|
|
@@ -4955,19 +5126,24 @@ class RouterLink {
|
|
|
4955
5126
|
* Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
|
|
4956
5127
|
* - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
|
|
4957
5128
|
* - **string**: shorthand for array of commands with just the string, i.e. `['/route']`
|
|
4958
|
-
* - **null|undefined**:
|
|
5129
|
+
* - **null|undefined**: effectively disables the `routerLink`
|
|
4959
5130
|
* @see {@link Router#createUrlTree Router#createUrlTree}
|
|
4960
5131
|
*/
|
|
4961
5132
|
set routerLink(commands) {
|
|
4962
5133
|
if (commands != null) {
|
|
4963
5134
|
this.commands = Array.isArray(commands) ? commands : [commands];
|
|
5135
|
+
this.setTabIndexIfNotOnNativeEl('0');
|
|
4964
5136
|
}
|
|
4965
5137
|
else {
|
|
4966
|
-
this.commands =
|
|
5138
|
+
this.commands = null;
|
|
5139
|
+
this.setTabIndexIfNotOnNativeEl(null);
|
|
4967
5140
|
}
|
|
4968
5141
|
}
|
|
4969
5142
|
/** @nodoc */
|
|
4970
5143
|
onClick() {
|
|
5144
|
+
if (this.urlTree === null) {
|
|
5145
|
+
return true;
|
|
5146
|
+
}
|
|
4971
5147
|
const extras = {
|
|
4972
5148
|
skipLocationChange: attrBoolValue(this.skipLocationChange),
|
|
4973
5149
|
replaceUrl: attrBoolValue(this.replaceUrl),
|
|
@@ -4977,6 +5153,9 @@ class RouterLink {
|
|
|
4977
5153
|
return true;
|
|
4978
5154
|
}
|
|
4979
5155
|
get urlTree() {
|
|
5156
|
+
if (this.commands === null) {
|
|
5157
|
+
return null;
|
|
5158
|
+
}
|
|
4980
5159
|
return this.router.createUrlTree(this.commands, {
|
|
4981
5160
|
// If the `relativeTo` input is not defined, we want to use `this.route` by default.
|
|
4982
5161
|
// Otherwise, we should use the value provided by the user in the input.
|
|
@@ -4988,28 +5167,38 @@ class RouterLink {
|
|
|
4988
5167
|
});
|
|
4989
5168
|
}
|
|
4990
5169
|
}
|
|
4991
|
-
RouterLink
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
];
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5170
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5171
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.12", type: RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: { queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick()" } }, usesOnChanges: true, ngImport: i0 });
|
|
5172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterLink, decorators: [{
|
|
5173
|
+
type: Directive,
|
|
5174
|
+
args: [{ selector: ':not(a):not(area)[routerLink]' }]
|
|
5175
|
+
}], ctorParameters: function () {
|
|
5176
|
+
return [{ type: Router }, { type: ActivatedRoute }, { type: undefined, decorators: [{
|
|
5177
|
+
type: Attribute,
|
|
5178
|
+
args: ['tabindex']
|
|
5179
|
+
}] }, { type: i0.Renderer2 }, { type: i0.ElementRef }];
|
|
5180
|
+
}, propDecorators: { queryParams: [{
|
|
5181
|
+
type: Input
|
|
5182
|
+
}], fragment: [{
|
|
5183
|
+
type: Input
|
|
5184
|
+
}], queryParamsHandling: [{
|
|
5185
|
+
type: Input
|
|
5186
|
+
}], preserveFragment: [{
|
|
5187
|
+
type: Input
|
|
5188
|
+
}], skipLocationChange: [{
|
|
5189
|
+
type: Input
|
|
5190
|
+
}], replaceUrl: [{
|
|
5191
|
+
type: Input
|
|
5192
|
+
}], state: [{
|
|
5193
|
+
type: Input
|
|
5194
|
+
}], relativeTo: [{
|
|
5195
|
+
type: Input
|
|
5196
|
+
}], routerLink: [{
|
|
5197
|
+
type: Input
|
|
5198
|
+
}], onClick: [{
|
|
5199
|
+
type: HostListener,
|
|
5200
|
+
args: ['click']
|
|
5201
|
+
}] } });
|
|
5013
5202
|
/**
|
|
5014
5203
|
* @description
|
|
5015
5204
|
*
|
|
@@ -5026,7 +5215,11 @@ class RouterLinkWithHref {
|
|
|
5026
5215
|
this.router = router;
|
|
5027
5216
|
this.route = route;
|
|
5028
5217
|
this.locationStrategy = locationStrategy;
|
|
5029
|
-
this.commands =
|
|
5218
|
+
this.commands = null;
|
|
5219
|
+
// the url displayed on the anchor element.
|
|
5220
|
+
// @HostBinding('attr.href') is used rather than @HostBinding() because it removes the
|
|
5221
|
+
// href attribute when it becomes `null`.
|
|
5222
|
+
this.href = null;
|
|
5030
5223
|
/** @internal */
|
|
5031
5224
|
this.onChanges = new Subject();
|
|
5032
5225
|
this.subscription = router.events.subscribe((s) => {
|
|
@@ -5039,7 +5232,7 @@ class RouterLinkWithHref {
|
|
|
5039
5232
|
* Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
|
|
5040
5233
|
* - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
|
|
5041
5234
|
* - **string**: shorthand for array of commands with just the string, i.e. `['/route']`
|
|
5042
|
-
* - **null|undefined**:
|
|
5235
|
+
* - **null|undefined**: Disables the link by removing the `href`
|
|
5043
5236
|
* @see {@link Router#createUrlTree Router#createUrlTree}
|
|
5044
5237
|
*/
|
|
5045
5238
|
set routerLink(commands) {
|
|
@@ -5047,7 +5240,7 @@ class RouterLinkWithHref {
|
|
|
5047
5240
|
this.commands = Array.isArray(commands) ? commands : [commands];
|
|
5048
5241
|
}
|
|
5049
5242
|
else {
|
|
5050
|
-
this.commands =
|
|
5243
|
+
this.commands = null;
|
|
5051
5244
|
}
|
|
5052
5245
|
}
|
|
5053
5246
|
/** @nodoc */
|
|
@@ -5064,7 +5257,7 @@ class RouterLinkWithHref {
|
|
|
5064
5257
|
if (button !== 0 || ctrlKey || shiftKey || altKey || metaKey) {
|
|
5065
5258
|
return true;
|
|
5066
5259
|
}
|
|
5067
|
-
if (typeof this.target === 'string' && this.target != '_self') {
|
|
5260
|
+
if (typeof this.target === 'string' && this.target != '_self' || this.urlTree === null) {
|
|
5068
5261
|
return true;
|
|
5069
5262
|
}
|
|
5070
5263
|
const extras = {
|
|
@@ -5076,9 +5269,14 @@ class RouterLinkWithHref {
|
|
|
5076
5269
|
return false;
|
|
5077
5270
|
}
|
|
5078
5271
|
updateTargetUrlAndHref() {
|
|
5079
|
-
this.href = this.
|
|
5272
|
+
this.href = this.urlTree !== null ?
|
|
5273
|
+
this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree)) :
|
|
5274
|
+
null;
|
|
5080
5275
|
}
|
|
5081
5276
|
get urlTree() {
|
|
5277
|
+
if (this.commands === null) {
|
|
5278
|
+
return null;
|
|
5279
|
+
}
|
|
5082
5280
|
return this.router.createUrlTree(this.commands, {
|
|
5083
5281
|
// If the `relativeTo` input is not defined, we want to use `this.route` by default.
|
|
5084
5282
|
// Otherwise, we should use the value provided by the user in the input.
|
|
@@ -5090,29 +5288,42 @@ class RouterLinkWithHref {
|
|
|
5090
5288
|
});
|
|
5091
5289
|
}
|
|
5092
5290
|
}
|
|
5093
|
-
RouterLinkWithHref
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
]
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
}
|
|
5291
|
+
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5292
|
+
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.12", type: RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target", "attr.href": "this.href" } }, usesOnChanges: true, ngImport: i0 });
|
|
5293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
5294
|
+
type: Directive,
|
|
5295
|
+
args: [{ selector: 'a[routerLink],area[routerLink]' }]
|
|
5296
|
+
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
|
|
5297
|
+
type: HostBinding,
|
|
5298
|
+
args: ['attr.target']
|
|
5299
|
+
}, {
|
|
5300
|
+
type: Input
|
|
5301
|
+
}], queryParams: [{
|
|
5302
|
+
type: Input
|
|
5303
|
+
}], fragment: [{
|
|
5304
|
+
type: Input
|
|
5305
|
+
}], queryParamsHandling: [{
|
|
5306
|
+
type: Input
|
|
5307
|
+
}], preserveFragment: [{
|
|
5308
|
+
type: Input
|
|
5309
|
+
}], skipLocationChange: [{
|
|
5310
|
+
type: Input
|
|
5311
|
+
}], replaceUrl: [{
|
|
5312
|
+
type: Input
|
|
5313
|
+
}], state: [{
|
|
5314
|
+
type: Input
|
|
5315
|
+
}], relativeTo: [{
|
|
5316
|
+
type: Input
|
|
5317
|
+
}], href: [{
|
|
5318
|
+
type: HostBinding,
|
|
5319
|
+
args: ['attr.href']
|
|
5320
|
+
}], routerLink: [{
|
|
5321
|
+
type: Input
|
|
5322
|
+
}], onClick: [{
|
|
5323
|
+
type: HostListener,
|
|
5324
|
+
args: ['click',
|
|
5325
|
+
['$event.button', '$event.ctrlKey', '$event.shiftKey', '$event.altKey', '$event.metaKey']]
|
|
5326
|
+
}] } });
|
|
5116
5327
|
function attrBoolValue(s) {
|
|
5117
5328
|
return s === '' || !!s;
|
|
5118
5329
|
}
|
|
@@ -5201,6 +5412,23 @@ class RouterLinkActive {
|
|
|
5201
5412
|
* @see Router.isActive
|
|
5202
5413
|
*/
|
|
5203
5414
|
this.routerLinkActiveOptions = { exact: false };
|
|
5415
|
+
/**
|
|
5416
|
+
*
|
|
5417
|
+
* You can use the output `isActiveChange` to get notified each time the link becomes
|
|
5418
|
+
* active or inactive.
|
|
5419
|
+
*
|
|
5420
|
+
* Emits:
|
|
5421
|
+
* true -> Route is active
|
|
5422
|
+
* false -> Route is inactive
|
|
5423
|
+
*
|
|
5424
|
+
* ```
|
|
5425
|
+
* <a
|
|
5426
|
+
* routerLink="/user/bob"
|
|
5427
|
+
* routerLinkActive="active-link"
|
|
5428
|
+
* (isActiveChange)="this.onRouterLinkActive($event)">Bob</a>
|
|
5429
|
+
* ```
|
|
5430
|
+
*/
|
|
5431
|
+
this.isActiveChange = new EventEmitter();
|
|
5204
5432
|
this.routerEventsSubscription = router.events.subscribe((s) => {
|
|
5205
5433
|
if (s instanceof NavigationEnd) {
|
|
5206
5434
|
this.update();
|
|
@@ -5257,15 +5485,17 @@ class RouterLinkActive {
|
|
|
5257
5485
|
this.renderer.removeClass(this.element.nativeElement, c);
|
|
5258
5486
|
}
|
|
5259
5487
|
});
|
|
5488
|
+
// Emit on isActiveChange after classes are updated
|
|
5489
|
+
this.isActiveChange.emit(hasActiveLinks);
|
|
5260
5490
|
}
|
|
5261
5491
|
});
|
|
5262
5492
|
}
|
|
5263
5493
|
isLinkActive(router) {
|
|
5264
|
-
const options =
|
|
5494
|
+
const options = isActiveMatchOptions(this.routerLinkActiveOptions) ?
|
|
5265
5495
|
this.routerLinkActiveOptions :
|
|
5266
5496
|
// While the types should disallow `undefined` here, it's possible without strict inputs
|
|
5267
5497
|
(this.routerLinkActiveOptions.exact || false);
|
|
5268
|
-
return (link) => router.isActive(link.urlTree, options);
|
|
5498
|
+
return (link) => link.urlTree ? router.isActive(link.urlTree, options) : false;
|
|
5269
5499
|
}
|
|
5270
5500
|
hasActiveLinks() {
|
|
5271
5501
|
const isActiveCheckFn = this.isLinkActive(this.router);
|
|
@@ -5274,214 +5504,38 @@ class RouterLinkActive {
|
|
|
5274
5504
|
this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
|
|
5275
5505
|
}
|
|
5276
5506
|
}
|
|
5277
|
-
RouterLinkActive
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
]
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
];
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
}
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
*/
|
|
5507
|
+
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }, { token: RouterLinkWithHref, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5508
|
+
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.12", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }, { propertyName: "linksWithHrefs", predicate: RouterLinkWithHref, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
|
|
5509
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5510
|
+
type: Directive,
|
|
5511
|
+
args: [{
|
|
5512
|
+
selector: '[routerLinkActive]',
|
|
5513
|
+
exportAs: 'routerLinkActive',
|
|
5514
|
+
}]
|
|
5515
|
+
}], ctorParameters: function () {
|
|
5516
|
+
return [{ type: Router }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: RouterLink, decorators: [{
|
|
5517
|
+
type: Optional
|
|
5518
|
+
}] }, { type: RouterLinkWithHref, decorators: [{
|
|
5519
|
+
type: Optional
|
|
5520
|
+
}] }];
|
|
5521
|
+
}, propDecorators: { links: [{
|
|
5522
|
+
type: ContentChildren,
|
|
5523
|
+
args: [RouterLink, { descendants: true }]
|
|
5524
|
+
}], linksWithHrefs: [{
|
|
5525
|
+
type: ContentChildren,
|
|
5526
|
+
args: [RouterLinkWithHref, { descendants: true }]
|
|
5527
|
+
}], routerLinkActiveOptions: [{
|
|
5528
|
+
type: Input
|
|
5529
|
+
}], isActiveChange: [{
|
|
5530
|
+
type: Output
|
|
5531
|
+
}], routerLinkActive: [{
|
|
5532
|
+
type: Input
|
|
5533
|
+
}] } });
|
|
5305
5534
|
/**
|
|
5306
|
-
*
|
|
5307
|
-
*
|
|
5308
|
-
* Acts as a placeholder that Angular dynamically fills based on the current router state.
|
|
5309
|
-
*
|
|
5310
|
-
* Each outlet can have a unique name, determined by the optional `name` attribute.
|
|
5311
|
-
* The name cannot be set or changed dynamically. If not set, default value is "primary".
|
|
5312
|
-
*
|
|
5313
|
-
* ```
|
|
5314
|
-
* <router-outlet></router-outlet>
|
|
5315
|
-
* <router-outlet name='left'></router-outlet>
|
|
5316
|
-
* <router-outlet name='right'></router-outlet>
|
|
5317
|
-
* ```
|
|
5318
|
-
*
|
|
5319
|
-
* Named outlets can be the targets of secondary routes.
|
|
5320
|
-
* The `Route` object for a secondary route has an `outlet` property to identify the target outlet:
|
|
5321
|
-
*
|
|
5322
|
-
* `{path: <base-path>, component: <component>, outlet: <target_outlet_name>}`
|
|
5323
|
-
*
|
|
5324
|
-
* Using named outlets and secondary routes, you can target multiple outlets in
|
|
5325
|
-
* the same `RouterLink` directive.
|
|
5326
|
-
*
|
|
5327
|
-
* The router keeps track of separate branches in a navigation tree for each named outlet and
|
|
5328
|
-
* generates a representation of that tree in the URL.
|
|
5329
|
-
* The URL for a secondary route uses the following syntax to specify both the primary and secondary
|
|
5330
|
-
* routes at the same time:
|
|
5331
|
-
*
|
|
5332
|
-
* `http://base-path/primary-route-path(outlet-name:route-path)`
|
|
5333
|
-
*
|
|
5334
|
-
* A router outlet emits an activate event when a new component is instantiated,
|
|
5335
|
-
* and a deactivate event when a component is destroyed.
|
|
5336
|
-
*
|
|
5337
|
-
* ```
|
|
5338
|
-
* <router-outlet
|
|
5339
|
-
* (activate)='onActivate($event)'
|
|
5340
|
-
* (deactivate)='onDeactivate($event)'></router-outlet>
|
|
5341
|
-
* ```
|
|
5342
|
-
*
|
|
5343
|
-
* @see [Routing tutorial](guide/router-tutorial-toh#named-outlets "Example of a named
|
|
5344
|
-
* outlet and secondary route configuration").
|
|
5345
|
-
* @see `RouterLink`
|
|
5346
|
-
* @see `Route`
|
|
5347
|
-
* @ngModule RouterModule
|
|
5348
|
-
*
|
|
5349
|
-
* @publicApi
|
|
5535
|
+
* Use instead of `'paths' in options` to be compatible with property renaming
|
|
5350
5536
|
*/
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
this.parentContexts = parentContexts;
|
|
5354
|
-
this.location = location;
|
|
5355
|
-
this.resolver = resolver;
|
|
5356
|
-
this.changeDetector = changeDetector;
|
|
5357
|
-
this.activated = null;
|
|
5358
|
-
this._activatedRoute = null;
|
|
5359
|
-
this.activateEvents = new EventEmitter();
|
|
5360
|
-
this.deactivateEvents = new EventEmitter();
|
|
5361
|
-
this.name = name || PRIMARY_OUTLET;
|
|
5362
|
-
parentContexts.onChildOutletCreated(this.name, this);
|
|
5363
|
-
}
|
|
5364
|
-
/** @nodoc */
|
|
5365
|
-
ngOnDestroy() {
|
|
5366
|
-
this.parentContexts.onChildOutletDestroyed(this.name);
|
|
5367
|
-
}
|
|
5368
|
-
/** @nodoc */
|
|
5369
|
-
ngOnInit() {
|
|
5370
|
-
if (!this.activated) {
|
|
5371
|
-
// If the outlet was not instantiated at the time the route got activated we need to populate
|
|
5372
|
-
// the outlet when it is initialized (ie inside a NgIf)
|
|
5373
|
-
const context = this.parentContexts.getContext(this.name);
|
|
5374
|
-
if (context && context.route) {
|
|
5375
|
-
if (context.attachRef) {
|
|
5376
|
-
// `attachRef` is populated when there is an existing component to mount
|
|
5377
|
-
this.attach(context.attachRef, context.route);
|
|
5378
|
-
}
|
|
5379
|
-
else {
|
|
5380
|
-
// otherwise the component defined in the configuration is created
|
|
5381
|
-
this.activateWith(context.route, context.resolver || null);
|
|
5382
|
-
}
|
|
5383
|
-
}
|
|
5384
|
-
}
|
|
5385
|
-
}
|
|
5386
|
-
get isActivated() {
|
|
5387
|
-
return !!this.activated;
|
|
5388
|
-
}
|
|
5389
|
-
/**
|
|
5390
|
-
* @returns The currently activated component instance.
|
|
5391
|
-
* @throws An error if the outlet is not activated.
|
|
5392
|
-
*/
|
|
5393
|
-
get component() {
|
|
5394
|
-
if (!this.activated)
|
|
5395
|
-
throw new Error('Outlet is not activated');
|
|
5396
|
-
return this.activated.instance;
|
|
5397
|
-
}
|
|
5398
|
-
get activatedRoute() {
|
|
5399
|
-
if (!this.activated)
|
|
5400
|
-
throw new Error('Outlet is not activated');
|
|
5401
|
-
return this._activatedRoute;
|
|
5402
|
-
}
|
|
5403
|
-
get activatedRouteData() {
|
|
5404
|
-
if (this._activatedRoute) {
|
|
5405
|
-
return this._activatedRoute.snapshot.data;
|
|
5406
|
-
}
|
|
5407
|
-
return {};
|
|
5408
|
-
}
|
|
5409
|
-
/**
|
|
5410
|
-
* Called when the `RouteReuseStrategy` instructs to detach the subtree
|
|
5411
|
-
*/
|
|
5412
|
-
detach() {
|
|
5413
|
-
if (!this.activated)
|
|
5414
|
-
throw new Error('Outlet is not activated');
|
|
5415
|
-
this.location.detach();
|
|
5416
|
-
const cmp = this.activated;
|
|
5417
|
-
this.activated = null;
|
|
5418
|
-
this._activatedRoute = null;
|
|
5419
|
-
return cmp;
|
|
5420
|
-
}
|
|
5421
|
-
/**
|
|
5422
|
-
* Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree
|
|
5423
|
-
*/
|
|
5424
|
-
attach(ref, activatedRoute) {
|
|
5425
|
-
this.activated = ref;
|
|
5426
|
-
this._activatedRoute = activatedRoute;
|
|
5427
|
-
this.location.insert(ref.hostView);
|
|
5428
|
-
}
|
|
5429
|
-
deactivate() {
|
|
5430
|
-
if (this.activated) {
|
|
5431
|
-
const c = this.component;
|
|
5432
|
-
this.activated.destroy();
|
|
5433
|
-
this.activated = null;
|
|
5434
|
-
this._activatedRoute = null;
|
|
5435
|
-
this.deactivateEvents.emit(c);
|
|
5436
|
-
}
|
|
5437
|
-
}
|
|
5438
|
-
activateWith(activatedRoute, resolver) {
|
|
5439
|
-
if (this.isActivated) {
|
|
5440
|
-
throw new Error('Cannot activate an already activated outlet');
|
|
5441
|
-
}
|
|
5442
|
-
this._activatedRoute = activatedRoute;
|
|
5443
|
-
const snapshot = activatedRoute._futureSnapshot;
|
|
5444
|
-
const component = snapshot.routeConfig.component;
|
|
5445
|
-
resolver = resolver || this.resolver;
|
|
5446
|
-
const factory = resolver.resolveComponentFactory(component);
|
|
5447
|
-
const childContexts = this.parentContexts.getOrCreateContext(this.name).children;
|
|
5448
|
-
const injector = new OutletInjector(activatedRoute, childContexts, this.location.injector);
|
|
5449
|
-
this.activated = this.location.createComponent(factory, this.location.length, injector);
|
|
5450
|
-
// Calling `markForCheck` to make sure we will run the change detection when the
|
|
5451
|
-
// `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component.
|
|
5452
|
-
this.changeDetector.markForCheck();
|
|
5453
|
-
this.activateEvents.emit(this.activated.instance);
|
|
5454
|
-
}
|
|
5455
|
-
}
|
|
5456
|
-
RouterOutlet.decorators = [
|
|
5457
|
-
{ type: Directive, args: [{ selector: 'router-outlet', exportAs: 'outlet' },] }
|
|
5458
|
-
];
|
|
5459
|
-
RouterOutlet.ctorParameters = () => [
|
|
5460
|
-
{ type: ChildrenOutletContexts },
|
|
5461
|
-
{ type: ViewContainerRef },
|
|
5462
|
-
{ type: ComponentFactoryResolver },
|
|
5463
|
-
{ type: String, decorators: [{ type: Attribute, args: ['name',] }] },
|
|
5464
|
-
{ type: ChangeDetectorRef }
|
|
5465
|
-
];
|
|
5466
|
-
RouterOutlet.propDecorators = {
|
|
5467
|
-
activateEvents: [{ type: Output, args: ['activate',] }],
|
|
5468
|
-
deactivateEvents: [{ type: Output, args: ['deactivate',] }]
|
|
5469
|
-
};
|
|
5470
|
-
class OutletInjector {
|
|
5471
|
-
constructor(route, childContexts, parent) {
|
|
5472
|
-
this.route = route;
|
|
5473
|
-
this.childContexts = childContexts;
|
|
5474
|
-
this.parent = parent;
|
|
5475
|
-
}
|
|
5476
|
-
get(token, notFoundValue) {
|
|
5477
|
-
if (token === ActivatedRoute) {
|
|
5478
|
-
return this.route;
|
|
5479
|
-
}
|
|
5480
|
-
if (token === ChildrenOutletContexts) {
|
|
5481
|
-
return this.childContexts;
|
|
5482
|
-
}
|
|
5483
|
-
return this.parent.get(token, notFoundValue);
|
|
5484
|
-
}
|
|
5537
|
+
function isActiveMatchOptions(options) {
|
|
5538
|
+
return !!options.paths;
|
|
5485
5539
|
}
|
|
5486
5540
|
|
|
5487
5541
|
/**
|
|
@@ -5543,13 +5597,13 @@ class NoPreloading {
|
|
|
5543
5597
|
* @publicApi
|
|
5544
5598
|
*/
|
|
5545
5599
|
class RouterPreloader {
|
|
5546
|
-
constructor(router,
|
|
5600
|
+
constructor(router, compiler, injector, preloadingStrategy) {
|
|
5547
5601
|
this.router = router;
|
|
5548
5602
|
this.injector = injector;
|
|
5549
5603
|
this.preloadingStrategy = preloadingStrategy;
|
|
5550
5604
|
const onStartLoad = (r) => router.triggerEvent(new RouteConfigLoadStart(r));
|
|
5551
5605
|
const onEndLoad = (r) => router.triggerEvent(new RouteConfigLoadEnd(r));
|
|
5552
|
-
this.loader = new RouterConfigLoader(
|
|
5606
|
+
this.loader = new RouterConfigLoader(injector, compiler, onStartLoad, onEndLoad);
|
|
5553
5607
|
}
|
|
5554
5608
|
setUpPreloading() {
|
|
5555
5609
|
this.subscription =
|
|
@@ -5597,24 +5651,12 @@ class RouterPreloader {
|
|
|
5597
5651
|
});
|
|
5598
5652
|
}
|
|
5599
5653
|
}
|
|
5600
|
-
RouterPreloader
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
{ type: NgModuleFactoryLoader },
|
|
5606
|
-
{ type: Compiler },
|
|
5607
|
-
{ type: Injector },
|
|
5608
|
-
{ type: PreloadingStrategy }
|
|
5609
|
-
];
|
|
5654
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.Injector }, { token: PreloadingStrategy }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5655
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterPreloader });
|
|
5656
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
5657
|
+
type: Injectable
|
|
5658
|
+
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.Injector }, { type: PreloadingStrategy }]; } });
|
|
5610
5659
|
|
|
5611
|
-
/**
|
|
5612
|
-
* @license
|
|
5613
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5614
|
-
*
|
|
5615
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
5616
|
-
* found in the LICENSE file at https://angular.io/license
|
|
5617
|
-
*/
|
|
5618
5660
|
class RouterScroller {
|
|
5619
5661
|
constructor(router,
|
|
5620
5662
|
/** @docsNotRequired */ viewportScroller, options = {}) {
|
|
@@ -5690,14 +5732,11 @@ class RouterScroller {
|
|
|
5690
5732
|
}
|
|
5691
5733
|
}
|
|
5692
5734
|
}
|
|
5693
|
-
RouterScroller
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
{ type: ViewportScroller },
|
|
5699
|
-
{ type: undefined }
|
|
5700
|
-
];
|
|
5735
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5736
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterScroller });
|
|
5737
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterScroller, decorators: [{
|
|
5738
|
+
type: Injectable
|
|
5739
|
+
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
5701
5740
|
|
|
5702
5741
|
/**
|
|
5703
5742
|
* @license
|
|
@@ -5720,7 +5759,6 @@ const ROUTER_CONFIGURATION = new InjectionToken('ROUTER_CONFIGURATION');
|
|
|
5720
5759
|
* @docsNotRequired
|
|
5721
5760
|
*/
|
|
5722
5761
|
const ROUTER_FORROOT_GUARD = new InjectionToken('ROUTER_FORROOT_GUARD');
|
|
5723
|
-
const ɵ0 = { enableTracing: false };
|
|
5724
5762
|
const ROUTER_PROVIDERS = [
|
|
5725
5763
|
Location,
|
|
5726
5764
|
{ provide: UrlSerializer, useClass: DefaultUrlSerializer },
|
|
@@ -5728,18 +5766,17 @@ const ROUTER_PROVIDERS = [
|
|
|
5728
5766
|
provide: Router,
|
|
5729
5767
|
useFactory: setupRouter,
|
|
5730
5768
|
deps: [
|
|
5731
|
-
UrlSerializer, ChildrenOutletContexts, Location, Injector,
|
|
5732
|
-
|
|
5769
|
+
UrlSerializer, ChildrenOutletContexts, Location, Injector, Compiler, ROUTES,
|
|
5770
|
+
ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()],
|
|
5733
5771
|
[RouteReuseStrategy, new Optional()]
|
|
5734
5772
|
]
|
|
5735
5773
|
},
|
|
5736
5774
|
ChildrenOutletContexts,
|
|
5737
5775
|
{ provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
|
|
5738
|
-
{ provide: NgModuleFactoryLoader, useClass: SystemJsNgModuleLoader },
|
|
5739
5776
|
RouterPreloader,
|
|
5740
5777
|
NoPreloading,
|
|
5741
5778
|
PreloadAllModules,
|
|
5742
|
-
{ provide: ROUTER_CONFIGURATION, useValue:
|
|
5779
|
+
{ provide: ROUTER_CONFIGURATION, useValue: { enableTracing: false } },
|
|
5743
5780
|
];
|
|
5744
5781
|
function routerNgProbeToken() {
|
|
5745
5782
|
return new NgProbeToken('Router', Router);
|
|
@@ -5838,17 +5875,26 @@ class RouterModule {
|
|
|
5838
5875
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
5839
5876
|
}
|
|
5840
5877
|
}
|
|
5841
|
-
RouterModule
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
]
|
|
5878
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5879
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
5880
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterModule });
|
|
5881
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterModule, decorators: [{
|
|
5882
|
+
type: NgModule,
|
|
5883
|
+
args: [{
|
|
5884
|
+
declarations: ROUTER_DIRECTIVES,
|
|
5885
|
+
exports: ROUTER_DIRECTIVES,
|
|
5886
|
+
entryComponents: [ɵEmptyOutletComponent]
|
|
5887
|
+
}]
|
|
5888
|
+
}], ctorParameters: function () {
|
|
5889
|
+
return [{ type: undefined, decorators: [{
|
|
5890
|
+
type: Optional
|
|
5891
|
+
}, {
|
|
5892
|
+
type: Inject,
|
|
5893
|
+
args: [ROUTER_FORROOT_GUARD]
|
|
5894
|
+
}] }, { type: Router, decorators: [{
|
|
5895
|
+
type: Optional
|
|
5896
|
+
}] }];
|
|
5897
|
+
} });
|
|
5852
5898
|
function createRouterScroller(router, viewportScroller, config) {
|
|
5853
5899
|
if (config.scrollOffset) {
|
|
5854
5900
|
viewportScroller.setOffset(config.scrollOffset);
|
|
@@ -5887,8 +5933,8 @@ function provideRoutes(routes) {
|
|
|
5887
5933
|
{ provide: ROUTES, multi: true, useValue: routes },
|
|
5888
5934
|
];
|
|
5889
5935
|
}
|
|
5890
|
-
function setupRouter(urlSerializer, contexts, location, injector,
|
|
5891
|
-
const router = new Router(null, urlSerializer, contexts, location, injector,
|
|
5936
|
+
function setupRouter(urlSerializer, contexts, location, injector, compiler, config, opts = {}, urlHandlingStrategy, routeReuseStrategy) {
|
|
5937
|
+
const router = new Router(null, urlSerializer, contexts, location, injector, compiler, flatten(config));
|
|
5892
5938
|
if (urlHandlingStrategy) {
|
|
5893
5939
|
router.urlHandlingStrategy = urlHandlingStrategy;
|
|
5894
5940
|
}
|
|
@@ -6011,12 +6057,11 @@ class RouterInitializer {
|
|
|
6011
6057
|
this.destroyed = true;
|
|
6012
6058
|
}
|
|
6013
6059
|
}
|
|
6014
|
-
RouterInitializer
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
];
|
|
6060
|
+
RouterInitializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterInitializer, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6061
|
+
RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterInitializer });
|
|
6062
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.12", ngImport: i0, type: RouterInitializer, decorators: [{
|
|
6063
|
+
type: Injectable
|
|
6064
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
6020
6065
|
function getAppInitializer(r) {
|
|
6021
6066
|
return r.appInitializer.bind(r);
|
|
6022
6067
|
}
|
|
@@ -6054,7 +6099,7 @@ function provideRouterInitializer() {
|
|
|
6054
6099
|
/**
|
|
6055
6100
|
* @publicApi
|
|
6056
6101
|
*/
|
|
6057
|
-
const VERSION = new Version('13.0.0-next.
|
|
6102
|
+
const VERSION = new Version('13.0.0-next.12');
|
|
6058
6103
|
|
|
6059
6104
|
/**
|
|
6060
6105
|
* @license
|
|
@@ -6093,5 +6138,5 @@ const VERSION = new Version('13.0.0-next.0');
|
|
|
6093
6138
|
* Generated bundle index. Do not edit.
|
|
6094
6139
|
*/
|
|
6095
6140
|
|
|
6096
|
-
export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultUrlSerializer, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, NoPreloading, OutletContext, PRIMARY_OUTLET, PreloadAllModules, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTES, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterLinkWithHref, RouterModule, RouterOutlet, RouterPreloader, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, convertToParamMap, provideRoutes, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS,
|
|
6097
|
-
//# sourceMappingURL=router.
|
|
6141
|
+
export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultUrlSerializer, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, NoPreloading, OutletContext, PRIMARY_OUTLET, PreloadAllModules, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTES, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterLinkWithHref, RouterModule, RouterOutlet, RouterPreloader, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, convertToParamMap, provideRoutes, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, assignExtraOptionsToRouter as ɵassignExtraOptionsToRouter, flatten as ɵflatten };
|
|
6142
|
+
//# sourceMappingURL=router.mjs.map
|