@angular/router 7.2.0-rc.0 → 7.2.3
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/bundles/router-testing.umd.js +4 -4
- package/bundles/router-testing.umd.js.map +1 -1
- package/bundles/router-testing.umd.min.js +2 -2
- package/bundles/router-testing.umd.min.js.map +1 -1
- package/bundles/router-upgrade.umd.js +4 -4
- package/bundles/router-upgrade.umd.js.map +1 -1
- package/bundles/router-upgrade.umd.min.js +2 -2
- package/bundles/router-upgrade.umd.min.js.map +1 -1
- package/bundles/router.umd.js +23 -13
- package/bundles/router.umd.js.map +1 -1
- package/bundles/router.umd.min.js +20 -20
- package/bundles/router.umd.min.js.map +1 -1
- package/esm2015/index.js +1 -1
- package/esm2015/public_api.js +1 -1
- package/esm2015/router.js +1 -1
- package/esm2015/src/apply_redirects.js +1 -1
- package/esm2015/src/components/empty_outlet.js +1 -1
- package/esm2015/src/config.js +1 -1
- package/esm2015/src/create_router_state.js +1 -1
- package/esm2015/src/create_url_tree.js +1 -1
- package/esm2015/src/directives/router_link.js +2 -2
- package/esm2015/src/directives/router_link_active.js +1 -1
- package/esm2015/src/directives/router_outlet.js +1 -1
- package/esm2015/src/events.js +1 -1
- package/esm2015/src/index.js +1 -1
- package/esm2015/src/interfaces.js +2 -2
- package/esm2015/src/operators/activate_routes.js +1 -1
- package/esm2015/src/operators/apply_redirects.js +1 -1
- package/esm2015/src/operators/check_guards.js +1 -1
- package/esm2015/src/operators/prioritized_guard_value.js +1 -1
- package/esm2015/src/operators/recognize.js +1 -1
- package/esm2015/src/operators/resolve_data.js +1 -1
- package/esm2015/src/operators/switch_tap.js +1 -1
- package/esm2015/src/private_export.js +1 -1
- package/esm2015/src/recognize.js +1 -1
- package/esm2015/src/route_reuse_strategy.js +1 -1
- package/esm2015/src/router.js +21 -6
- package/esm2015/src/router_config_loader.js +1 -1
- package/esm2015/src/router_module.js +1 -1
- package/esm2015/src/router_outlet_context.js +1 -1
- package/esm2015/src/router_preloader.js +1 -1
- package/esm2015/src/router_scroller.js +1 -1
- package/esm2015/src/router_state.js +1 -1
- package/esm2015/src/shared.js +1 -1
- package/esm2015/src/url_handling_strategy.js +1 -1
- package/esm2015/src/url_tree.js +1 -1
- package/esm2015/src/utils/collection.js +1 -1
- package/esm2015/src/utils/preactivation.js +1 -1
- package/esm2015/src/utils/tree.js +1 -1
- package/esm2015/src/utils/type_guards.js +1 -1
- package/esm2015/src/version.js +2 -2
- package/esm2015/testing/index.js +1 -1
- package/esm2015/testing/public_api.js +1 -1
- package/esm2015/testing/src/router_testing_module.js +1 -1
- package/esm2015/testing/src/testing.js +1 -1
- package/esm2015/testing/testing.js +1 -1
- package/esm2015/upgrade/index.js +1 -1
- package/esm2015/upgrade/public_api.js +1 -1
- package/esm2015/upgrade/src/upgrade.js +1 -1
- package/esm2015/upgrade/upgrade.js +1 -1
- package/esm5/index.js +1 -1
- package/esm5/public_api.js +1 -1
- package/esm5/router.js +1 -1
- package/esm5/src/apply_redirects.js +1 -1
- package/esm5/src/components/empty_outlet.js +1 -1
- package/esm5/src/config.js +1 -1
- package/esm5/src/create_router_state.js +1 -1
- package/esm5/src/create_url_tree.js +1 -1
- package/esm5/src/directives/router_link.js +2 -2
- package/esm5/src/directives/router_link_active.js +1 -1
- package/esm5/src/directives/router_outlet.js +1 -1
- package/esm5/src/events.js +1 -1
- package/esm5/src/index.js +1 -1
- package/esm5/src/interfaces.js +1 -1
- package/esm5/src/operators/activate_routes.js +1 -1
- package/esm5/src/operators/apply_redirects.js +1 -1
- package/esm5/src/operators/check_guards.js +1 -1
- package/esm5/src/operators/prioritized_guard_value.js +1 -1
- package/esm5/src/operators/recognize.js +1 -1
- package/esm5/src/operators/resolve_data.js +1 -1
- package/esm5/src/operators/switch_tap.js +1 -1
- package/esm5/src/private_export.js +1 -1
- package/esm5/src/recognize.js +1 -1
- package/esm5/src/route_reuse_strategy.js +1 -1
- package/esm5/src/router.js +16 -6
- package/esm5/src/router_config_loader.js +1 -1
- package/esm5/src/router_module.js +1 -1
- package/esm5/src/router_outlet_context.js +1 -1
- package/esm5/src/router_preloader.js +1 -1
- package/esm5/src/router_scroller.js +1 -1
- package/esm5/src/router_state.js +1 -1
- package/esm5/src/shared.js +1 -1
- package/esm5/src/url_handling_strategy.js +1 -1
- package/esm5/src/url_tree.js +1 -1
- package/esm5/src/utils/collection.js +1 -1
- package/esm5/src/utils/preactivation.js +1 -1
- package/esm5/src/utils/tree.js +1 -1
- package/esm5/src/utils/type_guards.js +1 -1
- package/esm5/src/version.js +2 -2
- package/esm5/testing/index.js +1 -1
- package/esm5/testing/public_api.js +1 -1
- package/esm5/testing/src/router_testing_module.js +1 -1
- package/esm5/testing/src/testing.js +1 -1
- package/esm5/testing/testing.js +1 -1
- package/esm5/upgrade/index.js +1 -1
- package/esm5/upgrade/public_api.js +1 -1
- package/esm5/upgrade/src/upgrade.js +1 -1
- package/esm5/upgrade/upgrade.js +1 -1
- package/fesm2015/router.js +22 -12
- package/fesm2015/router.js.map +1 -1
- package/fesm2015/testing.js +4 -4
- package/fesm2015/testing.js.map +1 -1
- package/fesm2015/upgrade.js +1 -1
- package/fesm2015/upgrade.js.map +1 -1
- package/fesm5/router.js +22 -12
- package/fesm5/router.js.map +1 -1
- package/fesm5/testing.js +4 -4
- package/fesm5/testing.js.map +1 -1
- package/fesm5/upgrade.js +1 -1
- package/fesm5/upgrade.js.map +1 -1
- package/package.json +4 -4
- package/router.metadata.json +1 -1
- package/src/config.d.ts +2 -1
- package/src/directives/router_link.d.ts +1 -1
- package/src/interfaces.d.ts +1 -1
- package/src/router.d.ts +1 -0
- package/testing.d.ts +2 -3
- package/upgrade.d.ts +2 -3
package/fesm2015/testing.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v7.2.
|
|
2
|
+
* @license Angular v7.2.3
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { Location, LocationStrategy } from '@angular/common';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { SpyLocation, MockLocationStrategy } from '@angular/common/testing';
|
|
9
|
+
import { Injectable, Compiler, NgModule, NgModuleFactoryLoader, Injector, Optional } from '@angular/core';
|
|
10
|
+
import { Router, ɵflatten, provideRoutes, ROUTER_CONFIGURATION, RouterModule, ɵROUTER_PROVIDERS, UrlSerializer, ChildrenOutletContexts, ROUTES, UrlHandlingStrategy, PreloadingStrategy, NoPreloading } from '@angular/router';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @fileoverview added by tsickle
|
package/fesm2015/testing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.js","sources":["../
|
|
1
|
+
{"version":3,"file":"testing.js","sources":["../testing/src/router_testing_module.ts","../testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Location, LocationStrategy} from '@angular/common';\nimport {MockLocationStrategy, SpyLocation} from '@angular/common/testing';\nimport {Compiler, Injectable, Injector, ModuleWithProviders, NgModule, NgModuleFactory, NgModuleFactoryLoader, Optional} from '@angular/core';\nimport {ChildrenOutletContexts, ExtraOptions, NoPreloading, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTES, Route, Router, RouterModule, Routes, UrlHandlingStrategy, UrlSerializer, provideRoutes, ɵROUTER_PROVIDERS as ROUTER_PROVIDERS, ɵflatten as flatten} from '@angular/router';\n\n\n\n/**\n * @description\n *\n * Allows to simulate the loading of ng modules in tests.\n *\n * ```\n * const loader = TestBed.get(NgModuleFactoryLoader);\n *\n * @Component({template: 'lazy-loaded'})\n * class LazyLoadedComponent {}\n * @NgModule({\n * declarations: [LazyLoadedComponent],\n * imports: [RouterModule.forChild([{path: 'loaded', component: LazyLoadedComponent}])]\n * })\n *\n * class LoadedModule {}\n *\n * // sets up stubbedModules\n * loader.stubbedModules = {lazyModule: LoadedModule};\n *\n * router.resetConfig([\n * {path: 'lazy', loadChildren: 'lazyModule'},\n * ]);\n *\n * router.navigateByUrl('/lazy/loaded');\n * ```\n *\n * @publicApi\n */\n@Injectable()\nexport class SpyNgModuleFactoryLoader implements NgModuleFactoryLoader {\n /**\n * @docsNotRequired\n */\n private _stubbedModules: {[path: string]: Promise<NgModuleFactory<any>>} = {};\n\n /**\n * @docsNotRequired\n */\n set stubbedModules(modules: {[path: string]: any}) {\n const res: {[path: string]: any} = {};\n for (const t of Object.keys(modules)) {\n res[t] = this.compiler.compileModuleAsync(modules[t]);\n }\n this._stubbedModules = res;\n }\n\n /**\n * @docsNotRequired\n */\n get stubbedModules(): {[path: string]: any} { return this._stubbedModules; }\n\n constructor(private compiler: Compiler) {}\n\n load(path: string): Promise<NgModuleFactory<any>> {\n if (this._stubbedModules[path]) {\n return this._stubbedModules[path];\n } else {\n return <any>Promise.reject(new Error(`Cannot find module ${path}`));\n }\n }\n}\n\nfunction isUrlHandlingStrategy(opts: ExtraOptions | UrlHandlingStrategy):\n opts is UrlHandlingStrategy {\n // This property check is needed because UrlHandlingStrategy is an interface and doesn't exist at\n // runtime.\n return 'shouldProcessUrl' in opts;\n}\n\n/**\n * Router setup factory function used for testing.\n *\n * @publicApi\n */\nexport function setupTestingRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][],\n opts?: ExtraOptions, urlHandlingStrategy?: UrlHandlingStrategy): Router;\n\n/**\n * Router setup factory function used for testing.\n *\n * @deprecated As of v5.2. The 2nd-to-last argument should be `ExtraOptions`, not\n * `UrlHandlingStrategy`\n * @publicApi\n */\nexport function setupTestingRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][],\n urlHandlingStrategy?: UrlHandlingStrategy): Router;\n\n/**\n * Router setup factory function used for testing.\n *\n * @publicApi\n */\nexport function setupTestingRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][],\n opts?: ExtraOptions | UrlHandlingStrategy, urlHandlingStrategy?: UrlHandlingStrategy) {\n const router = new Router(\n null !, urlSerializer, contexts, location, injector, loader, compiler, flatten(routes));\n if (opts) {\n // Handle deprecated argument ordering.\n if (isUrlHandlingStrategy(opts)) {\n router.urlHandlingStrategy = opts;\n } else {\n // Handle ExtraOptions\n\n if (opts.malformedUriErrorHandler) {\n router.malformedUriErrorHandler = opts.malformedUriErrorHandler;\n }\n\n if (opts.paramsInheritanceStrategy) {\n router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;\n }\n }\n }\n\n if (urlHandlingStrategy) {\n router.urlHandlingStrategy = urlHandlingStrategy;\n }\n return router;\n}\n\n/**\n * @description\n *\n * Sets up the router to be used for testing.\n *\n * The modules sets up the router to be used for testing.\n * It provides spy implementations of `Location`, `LocationStrategy`, and {@link\n * NgModuleFactoryLoader}.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * beforeEach(() => {\n * TestBed.configureTestModule({\n * imports: [\n * RouterTestingModule.withRoutes(\n * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]\n * )\n * ]\n * });\n * });\n * ```\n *\n * @publicApi\n */\n@NgModule({\n exports: [RouterModule],\n providers: [\n ROUTER_PROVIDERS, {provide: Location, useClass: SpyLocation},\n {provide: LocationStrategy, useClass: MockLocationStrategy},\n {provide: NgModuleFactoryLoader, useClass: SpyNgModuleFactoryLoader}, {\n provide: Router,\n useFactory: setupTestingRouter,\n deps: [\n UrlSerializer, ChildrenOutletContexts, Location, NgModuleFactoryLoader, Compiler, Injector,\n ROUTES, ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()]\n ]\n },\n {provide: PreloadingStrategy, useExisting: NoPreloading}, provideRoutes([])\n ]\n})\nexport class RouterTestingModule {\n static withRoutes(routes: Routes, config?: ExtraOptions):\n ModuleWithProviders<RouterTestingModule> {\n return {\n ngModule: RouterTestingModule,\n providers: [\n provideRoutes(routes),\n {provide: ROUTER_CONFIGURATION, useValue: config ? config : {}},\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["flatten","ROUTER_PROVIDERS"],"mappings":"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"}
|
package/fesm2015/upgrade.js
CHANGED
package/fesm2015/upgrade.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.js","sources":["../
|
|
1
|
+
{"version":3,"file":"upgrade.js","sources":["../upgrade/src/upgrade.ts","../upgrade/upgrade.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Location} from '@angular/common';\nimport {APP_BOOTSTRAP_LISTENER, ComponentRef, InjectionToken} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {UpgradeModule} from '@angular/upgrade/static';\n\n/**\n * @description\n *\n * Creates an initializer that in addition to setting up the Angular\n * router sets up the ngRoute integration.\n *\n * ```\n * @NgModule({\n * imports: [\n * RouterModule.forRoot(SOME_ROUTES),\n * UpgradeModule\n * ],\n * providers: [\n * RouterUpgradeInitializer\n * ]\n * })\n * export class AppModule {\n * ngDoBootstrap() {}\n * }\n * ```\n *\n * @publicApi\n */\nexport const RouterUpgradeInitializer = {\n provide: APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: locationSyncBootstrapListener as(ngUpgrade: UpgradeModule) => () => void,\n deps: [UpgradeModule]\n};\n\n/**\n * @internal\n */\nexport function locationSyncBootstrapListener(ngUpgrade: UpgradeModule) {\n return () => { setUpLocationSync(ngUpgrade); };\n}\n\n/**\n * @description\n *\n * Sets up a location synchronization.\n *\n * History.pushState does not fire onPopState, so the Angular location\n * doesn't detect it. The workaround is to attach a location change listener\n *\n * @publicApi\n */\nexport function setUpLocationSync(ngUpgrade: UpgradeModule) {\n if (!ngUpgrade.$injector) {\n throw new Error(`\n RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.\n Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.\n `);\n }\n\n const router: Router = ngUpgrade.injector.get(Router);\n const location: Location = ngUpgrade.injector.get(Location);\n\n ngUpgrade.$injector.get('$rootScope')\n .$on('$locationChangeStart', (_: any, next: string, __: string) => {\n const url = resolveUrl(next);\n const path = location.normalize(url.pathname);\n router.navigateByUrl(path + url.search + url.hash);\n });\n}\n\n/**\n * Normalize and parse a URL.\n *\n * - Normalizing means that a relative URL will be resolved into an absolute URL in the context of\n * the application document.\n * - Parsing means that the anchor's `protocol`, `hostname`, `port`, `pathname` and related\n * properties are all populated to reflect the normalized URL.\n *\n * While this approach has wide compatibility, it doesn't work as expected on IE. On IE, normalizing\n * happens similar to other browsers, but the parsed components will not be set. (E.g. if you assign\n * `a.href = 'foo'`, then `a.protocol`, `a.host`, etc. will not be correctly updated.)\n * We work around that by performing the parsing in a 2nd step by taking a previously normalized URL\n * and assigning it again. This correctly populates all properties.\n *\n * See\n * https://github.com/angular/angular.js/blob/2c7400e7d07b0f6cec1817dab40b9250ce8ebce6/src/ng/urlUtils.js#L26-L33\n * for more info.\n */\nlet anchor: HTMLAnchorElement|undefined;\nfunction resolveUrl(url: string): {pathname: string, search: string, hash: string} {\n if (!anchor) {\n anchor = document.createElement('a');\n }\n\n anchor.setAttribute('href', url);\n anchor.setAttribute('href', anchor.href);\n\n return {\n // IE does not start `pathname` with `/` like other browsers.\n pathname: `/${anchor.pathname.replace(/^\\//, '')}`,\n search: anchor.search,\n hash: anchor.hash\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,wBAAwB,GAAG;IACtC,OAAO,EAAE,sBAAsB;IAC/B,KAAK,EAAE,IAAI;IACX,UAAU,qBAAE,6BAA6B,EAA2C;IACpF,IAAI,EAAE,CAAC,aAAa,CAAC;CACtB;;;;;;AAKD,SAAgB,6BAA6B,CAAC,SAAwB;IACpE,OAAO,QAAQ,iBAAiB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;CAChD;;;;;;;;;;;;;AAYD,SAAgB,iBAAiB,CAAC,SAAwB;IACxD,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC;;;OAGb,CAAC,CAAC;KACN;;UAEK,MAAM,GAAW,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;;UAC/C,QAAQ,GAAa,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;IAE3D,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC;SAChC,GAAG,CAAC,sBAAsB,EAAE,CAAC,CAAM,EAAE,IAAY,EAAE,EAAU;;cACtD,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC;;cACtB,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC7C,MAAM,CAAC,aAAa,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;KACpD,CAAC,CAAC;CACR;;;;;;;;;;;;;;;;;;;;IAoBG,MAAmC;;;;;AACvC,SAAS,UAAU,CAAC,GAAW;IAC7B,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;KACtC;IAED,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAEzC,OAAO;;QAEL,QAAQ,EAAE,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE;QAClD,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,IAAI,EAAE,MAAM,CAAC,IAAI;KAClB,CAAC;CACH;;;;;;;;;;;;AChHD;;GAEG;;;;"}
|
package/fesm5/router.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v7.2.
|
|
2
|
+
* @license Angular v7.2.3
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { __extends, __decorate, __assign, __values, __spread, __metadata, __param } from 'tslib';
|
|
8
|
+
import { LocationStrategy, Location, PlatformLocation, APP_BASE_HREF, ViewportScroller, HashLocationStrategy, PathLocationStrategy, LOCATION_INITIALIZED } from '@angular/common';
|
|
9
|
+
import { Component, ɵisObservable, ɵisPromise, NgModuleRef, InjectionToken, NgModuleFactory, isDevMode, NgZone, ɵConsole, Input, HostListener, Directive, Attribute, Renderer2, ElementRef, HostBinding, ContentChildren, QueryList, ChangeDetectorRef, Output, ViewContainerRef, ComponentFactoryResolver, EventEmitter, Injectable, NgModuleFactoryLoader, Compiler, Injector, ApplicationRef, Optional, SystemJsNgModuleLoader, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, Inject, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, Version } from '@angular/core';
|
|
9
10
|
import { from, of, BehaviorSubject, EmptyError, Observable, combineLatest, defer, EMPTY, Subject } from 'rxjs';
|
|
10
|
-
import { concatAll, last,
|
|
11
|
-
import { LocationStrategy, APP_BASE_HREF, HashLocationStrategy, LOCATION_INITIALIZED, Location, PathLocationStrategy, PlatformLocation, ViewportScroller } from '@angular/common';
|
|
11
|
+
import { map, concatAll, last, catchError, first, mergeMap, every, switchMap, take, startWith, scan, filter, concatMap, reduce, tap, finalize, mergeAll } from 'rxjs/operators';
|
|
12
12
|
import { ɵgetDOM } from '@angular/platform-browser';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -3776,6 +3776,7 @@ var Router = /** @class */ (function () {
|
|
|
3776
3776
|
this.resetConfig(config);
|
|
3777
3777
|
this.currentUrlTree = createEmptyUrlTree();
|
|
3778
3778
|
this.rawUrlTree = this.currentUrlTree;
|
|
3779
|
+
this.browserUrlTree = this.currentUrlTree;
|
|
3779
3780
|
this.configLoader = new RouterConfigLoader(loader, compiler, onLoadStart, onLoadEnd);
|
|
3780
3781
|
this.routerState = createEmptyState(this.currentUrlTree, this.rootComponentType);
|
|
3781
3782
|
this.transitions = new BehaviorSubject({
|
|
@@ -3824,7 +3825,7 @@ var Router = /** @class */ (function () {
|
|
|
3824
3825
|
var completed = false;
|
|
3825
3826
|
var errored = false;
|
|
3826
3827
|
return of(t).pipe(switchMap(function (t) {
|
|
3827
|
-
var urlTransition = !_this.navigated || t.extractedUrl.toString() !== _this.
|
|
3828
|
+
var urlTransition = !_this.navigated || t.extractedUrl.toString() !== _this.browserUrlTree.toString();
|
|
3828
3829
|
var processCurrentUrl = (_this.onSameUrlNavigation === 'reload' ? true : urlTransition) &&
|
|
3829
3830
|
_this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl);
|
|
3830
3831
|
if (processCurrentUrl) {
|
|
@@ -3850,8 +3851,14 @@ var Router = /** @class */ (function () {
|
|
|
3850
3851
|
// Recognize
|
|
3851
3852
|
recognize$1(_this.rootComponentType, _this.config, function (url) { return _this.serializeUrl(url); }, _this.paramsInheritanceStrategy, _this.relativeLinkResolution),
|
|
3852
3853
|
// Update URL if in `eager` update mode
|
|
3853
|
-
tap(function (t) {
|
|
3854
|
-
_this.
|
|
3854
|
+
tap(function (t) {
|
|
3855
|
+
if (_this.urlUpdateStrategy === 'eager') {
|
|
3856
|
+
if (!t.extras.skipLocationChange) {
|
|
3857
|
+
_this.setBrowserUrl(t.urlAfterRedirects, !!t.extras.replaceUrl, t.id);
|
|
3858
|
+
}
|
|
3859
|
+
_this.browserUrlTree = t.urlAfterRedirects;
|
|
3860
|
+
}
|
|
3861
|
+
}),
|
|
3855
3862
|
// Fire RoutesRecognized
|
|
3856
3863
|
tap(function (t) {
|
|
3857
3864
|
var routesRecognized = new RoutesRecognized(t.id, _this.serializeUrl(t.extractedUrl), _this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);
|
|
@@ -3953,8 +3960,11 @@ var Router = /** @class */ (function () {
|
|
|
3953
3960
|
_this.currentUrlTree = t.urlAfterRedirects;
|
|
3954
3961
|
_this.rawUrlTree = _this.urlHandlingStrategy.merge(_this.currentUrlTree, t.rawUrl);
|
|
3955
3962
|
_this.routerState = t.targetRouterState;
|
|
3956
|
-
if (_this.urlUpdateStrategy === 'deferred'
|
|
3957
|
-
|
|
3963
|
+
if (_this.urlUpdateStrategy === 'deferred') {
|
|
3964
|
+
if (!t.extras.skipLocationChange) {
|
|
3965
|
+
_this.setBrowserUrl(_this.rawUrlTree, !!t.extras.replaceUrl, t.id, t.extras.state);
|
|
3966
|
+
}
|
|
3967
|
+
_this.browserUrlTree = t.urlAfterRedirects;
|
|
3958
3968
|
}
|
|
3959
3969
|
}), activateRoutes(_this.rootContexts, _this.routeReuseStrategy, function (evt) { return _this.triggerEvent(evt); }), tap({ next: function () { completed = true; }, complete: function () { completed = true; } }), finalize(function () {
|
|
3960
3970
|
/* When the navigation stream finishes either through error or success, we set the
|
|
@@ -4404,7 +4414,7 @@ function validateCommands(commands) {
|
|
|
4404
4414
|
* </a>
|
|
4405
4415
|
* ```
|
|
4406
4416
|
*
|
|
4407
|
-
* You can tell the directive
|
|
4417
|
+
* You can tell the directive how to handle queryParams. Available options are:
|
|
4408
4418
|
* - `'merge'`: merge the queryParams into the current queryParams
|
|
4409
4419
|
* - `'preserve'`: preserve the current queryParams
|
|
4410
4420
|
* - default/`''`: use the queryParams only
|
|
@@ -5702,7 +5712,7 @@ function provideRouterInitializer() {
|
|
|
5702
5712
|
/**
|
|
5703
5713
|
* @publicApi
|
|
5704
5714
|
*/
|
|
5705
|
-
var VERSION = new Version('7.2.
|
|
5715
|
+
var VERSION = new Version('7.2.3');
|
|
5706
5716
|
|
|
5707
5717
|
/**
|
|
5708
5718
|
* @license
|