@angular/router 5.2.4 → 5.2.8
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 +2 -2
- 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 +2 -2
- package/bundles/router-upgrade.umd.min.js +2 -2
- package/bundles/router-upgrade.umd.min.js.map +1 -1
- package/bundles/router.umd.js +149 -76
- package/bundles/router.umd.js.map +1 -1
- package/bundles/router.umd.min.js +6 -6
- package/bundles/router.umd.min.js.map +1 -1
- package/esm2015/router.js +131 -74
- package/esm2015/router.js.map +1 -1
- package/esm2015/testing.js +1 -1
- package/esm2015/upgrade.js +1 -1
- package/esm5/router.js +148 -75
- package/esm5/router.js.map +1 -1
- package/esm5/testing.js +1 -1
- package/esm5/upgrade.js +1 -1
- package/package.json +4 -4
- package/router.metadata.json +1 -1
- package/src/config.d.ts +1 -0
- package/src/router.d.ts +5 -0
- package/src/url_tree.d.ts +14 -10
- package/testing.d.ts +1 -1
- package/upgrade.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v5.2.
|
|
2
|
+
* @license Angular v5.2.8
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}(this, (function (exports,_angular_common,_angular_common_testing,_angular_core,_angular_router) { 'use strict';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @license Angular v5.2.
|
|
13
|
+
* @license Angular v5.2.8
|
|
14
14
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
15
15
|
* License: MIT
|
|
16
16
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v5.2.
|
|
2
|
+
* @license Angular v5.2.8
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/common"),require("@angular/common/testing"),require("@angular/core"),require("@angular/router")):"function"==typeof define&&define.amd?define("@angular/router/testing",["exports","@angular/common","@angular/common/testing","@angular/core","@angular/router"],factory):factory((global.ng=global.ng||{},global.ng.router=global.ng.router||{},global.ng.router.testing={}),global.ng.common,global.ng.common.testing,global.ng.core,global.ng.router)}(this,function(exports,_angular_common,_angular_common_testing,_angular_core,_angular_router){"use strict";function isUrlHandlingStrategy(opts){return"shouldProcessUrl"in opts}function setupTestingRouter(urlSerializer,contexts,location,loader,compiler,injector,routes,opts,urlHandlingStrategy){var router=new _angular_router.Router(null,urlSerializer,contexts,location,injector,loader,compiler,_angular_router.ɵflatten(routes));return opts&&(isUrlHandlingStrategy(opts)?router.urlHandlingStrategy=opts:opts.paramsInheritanceStrategy&&(router.paramsInheritanceStrategy=opts.paramsInheritanceStrategy)),urlHandlingStrategy&&(router.urlHandlingStrategy=urlHandlingStrategy),router}/**
|
|
7
|
-
* @license Angular v5.2.
|
|
7
|
+
* @license Angular v5.2.8
|
|
8
8
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
9
9
|
* License: MIT
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["router-testing.umd.js"],"names":["global","factory","exports","module","require","define","amd","ng","router","testing","common","core","this","_angular_common","_angular_common_testing","_angular_core","_angular_router","isUrlHandlingStrategy","opts","setupTestingRouter","urlSerializer","contexts","location","loader","compiler","injector","routes","urlHandlingStrategy","Router","ɵflatten","paramsInheritanceStrategy","SpyNgModuleFactoryLoader","_stubbedModules","Object","defineProperty","prototype","get","set","modules","res","_i","_a","keys","length","t","compileModuleAsync","enumerable","configurable","load","path","Promise","reject","Error","decorators","type","Injectable","ctorParameters","Compiler","RouterTestingModule","withRoutes","config","ngModule","providers","provideRoutes","provide","ROUTER_CONFIGURATION","useValue","NgModule","args","RouterModule","ɵROUTER_PROVIDERS","Location","useClass","SpyLocation","LocationStrategy","MockLocationStrategy","NgModuleFactoryLoader","useFactory","deps","UrlSerializer","ChildrenOutletContexts","Injector","ROUTES","UrlHandlingStrategy","Optional","PreloadingStrategy","useExisting","NoPreloading","value"],"mappings":";;;;;CAKC,SAAUA,OAAQC,SACC,gBAAZC,UAA0C,mBAAXC,QAAyBF,QAAQC,QAASE,QAAQ,mBAAoBA,QAAQ,2BAA4BA,QAAQ,iBAAkBA,QAAQ,oBAChK,kBAAXC,SAAyBA,OAAOC,IAAMD,OAAO,2BAA4B,UAAW,kBAAmB,0BAA2B,gBAAiB,mBAAoBJ,SAC7KA,SAASD,OAAOO,GAAKP,OAAOO,OAAUP,OAAOO,GAAGC,OAASR,OAAOO,GAAGC,WAAcR,OAAOO,GAAGC,OAAOC,YAAcT,OAAOO,GAAGG,OAAOV,OAAOO,GAAGG,OAAOD,QAAQT,OAAOO,GAAGI,KAAKX,OAAOO,GAAGC,SACnLI,KAAM,SAAWV,QAAQW,gBAAgBC,wBAAwBC,cAAcC,iBAAmB,YAgHpG,SAASC,uBAAsBC,MAG3B,MAAO,oBAAsBA,MAiBjC,QAASC,oBAAmBC,cAAeC,SAAUC,SAAUC,OAAQC,SAAUC,SAAUC,OAAQR,KAAMS,qBACrG,GAAqBnB,QAAS,GAAIQ,iBAAgBY,OAAwB,KAAUR,cAAeC,SAAUC,SAAUG,SAAUF,OAAQC,SAAUR,gBAAgBa,SAASH,QAa5K,OAXIR,QACID,sBAAsBC,MACtBV,OAAOmB,oBAAsBT,KAExBA,KAAKY,4BACVtB,OAAOsB,0BAA4BZ,KAAKY,4BAG5CH,sBACAnB,OAAOmB,oBAAsBA,qBAE1BnB;;;;;;;;;;;;AAnGX,GAAIuB,0BAA0C,WAC1C,QAASA,0BAAyBP,UAC9BZ,KAAKY,SAAWA,SAIhBZ,KAAKoB,mB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D,gBAAgBmE,oBAAqB,GAAIpE,eAAcqE,aAG5HpB,QAAShD,gBAAgBqE,mBAAoBC,YAAatE,gBAAgBuE,cAAgBvE,gBAAgB+C,uBAKhIL,oBAAoBF,eAAiB,WAAc,UAC5CE,sBAGXxD,SAAQ6B,yBAA2BA,yBACnC7B,QAAQiB,mBAAqBA,mBAC7BjB,QAAQwD,oBAAsBA,oBAE9BzB,OAAOC,eAAehC,QAAS,cAAgBsF,OAAO","file":"router-testing.umd.min.js","sourcesContent":["/**\n * @license Angular v5.2.4\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/common/testing'), require('@angular/core'), require('@angular/router')) :\n\ttypeof define === 'function' && define.amd ? define('@angular/router/testing', ['exports', '@angular/common', '@angular/common/testing', '@angular/core', '@angular/router'], factory) :\n\t(factory((global.ng = global.ng || {}, global.ng.router = global.ng.router || {}, global.ng.router.testing = {}),global.ng.common,global.ng.common.testing,global.ng.core,global.ng.router));\n}(this, (function (exports,_angular_common,_angular_common_testing,_angular_core,_angular_router) { 'use strict';\n\n/**\n * @license Angular v5.2.4\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\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/**\n * \\@whatItDoes Allows to simulate the loading of ng modules in tests.\n *\n * \\@howToUse\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 * \\@stable\n */\nvar SpyNgModuleFactoryLoader = /** @class */ (function () {\n function SpyNgModuleFactoryLoader(compiler) {\n this.compiler = compiler;\n /**\n * \\@docsNotRequired\n */\n this._stubbedModules = {};\n }\n Object.defineProperty(SpyNgModuleFactoryLoader.prototype, \"stubbedModules\", {\n /**\n * @docsNotRequired\n */\n get: /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { return this._stubbedModules; },\n /**\n * @docsNotRequired\n */\n set: /**\n * \\@docsNotRequired\n * @param {?} modules\n * @return {?}\n */\n function (modules) {\n var /** @type {?} */ res = {};\n for (var _i = 0, _a = Object.keys(modules); _i < _a.length; _i++) {\n var t = _a[_i];\n res[t] = this.compiler.compileModuleAsync(modules[t]);\n }\n this._stubbedModules = res;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} path\n * @return {?}\n */\n SpyNgModuleFactoryLoader.prototype.load = /**\n * @param {?} path\n * @return {?}\n */\n function (path) {\n if (this._stubbedModules[path]) {\n return this._stubbedModules[path];\n }\n else {\n return /** @type {?} */ (Promise.reject(new Error(\"Cannot find module \" + path)));\n }\n };\n SpyNgModuleFactoryLoader.decorators = [\n { type: _angular_core.Injectable },\n ];\n /** @nocollapse */\n SpyNgModuleFactoryLoader.ctorParameters = function () { return [\n { type: _angular_core.Compiler, },\n ]; };\n return SpyNgModuleFactoryLoader;\n}());\n/**\n * @param {?} opts\n * @return {?}\n */\nfunction isUrlHandlingStrategy(opts) {\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 * Router setup factory function used for testing.\n *\n * \\@stable\n * @param {?} urlSerializer\n * @param {?} contexts\n * @param {?} location\n * @param {?} loader\n * @param {?} compiler\n * @param {?} injector\n * @param {?} routes\n * @param {?=} opts\n * @param {?=} urlHandlingStrategy\n * @return {?}\n */\nfunction setupTestingRouter(urlSerializer, contexts, location, loader, compiler, injector, routes, opts, urlHandlingStrategy) {\n var /** @type {?} */ router = new _angular_router.Router(/** @type {?} */ ((null)), urlSerializer, contexts, location, injector, loader, compiler, _angular_router.ɵflatten(routes));\n // Handle deprecated argument ordering.\n if (opts) {\n if (isUrlHandlingStrategy(opts)) {\n router.urlHandlingStrategy = opts;\n }\n else if (opts.paramsInheritanceStrategy) {\n router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;\n }\n }\n if (urlHandlingStrategy) {\n router.urlHandlingStrategy = urlHandlingStrategy;\n }\n return router;\n}\n/**\n * \\@whatItDoes Sets up the router to be used for testing.\n *\n * \\@howToUse\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 * \\@description\n *\n * The modules sets up the router to be used for testing.\n * It provides spy implementations of {\\@link Location}, {\\@link LocationStrategy}, and {\\@link\n * NgModuleFactoryLoader}.\n *\n * \\@stable\n */\nvar RouterTestingModule = /** @class */ (function () {\n function RouterTestingModule() {\n }\n /**\n * @param {?} routes\n * @param {?=} config\n * @return {?}\n */\n RouterTestingModule.withRoutes = /**\n * @param {?} routes\n * @param {?=} config\n * @return {?}\n */\n function (routes, config) {\n return {\n ngModule: RouterTestingModule,\n providers: [\n _angular_router.provideRoutes(routes),\n { provide: _angular_router.ROUTER_CONFIGURATION, useValue: config ? config : {} },\n ]\n };\n };\n RouterTestingModule.decorators = [\n { type: _angular_core.NgModule, args: [{\n exports: [_angular_router.RouterModule],\n providers: [\n _angular_router.ɵROUTER_PROVIDERS, { provide: _angular_common.Location, useClass: _angular_common_testing.SpyLocation },\n { provide: _angular_common.LocationStrategy, useClass: _angular_common_testing.MockLocationStrategy },\n { provide: _angular_core.NgModuleFactoryLoader, useClass: SpyNgModuleFactoryLoader }, {\n provide: _angular_router.Router,\n useFactory: setupTestingRouter,\n deps: [\n _angular_router.UrlSerializer, _angular_router.ChildrenOutletContexts, _angular_common.Location, _angular_core.NgModuleFactoryLoader, _angular_core.Compiler, _angular_core.Injector,\n _angular_router.ROUTES, _angular_router.ROUTER_CONFIGURATION, [_angular_router.UrlHandlingStrategy, new _angular_core.Optional()]\n ]\n },\n { provide: _angular_router.PreloadingStrategy, useExisting: _angular_router.NoPreloading }, _angular_router.provideRoutes([])\n ]\n },] },\n ];\n /** @nocollapse */\n RouterTestingModule.ctorParameters = function () { return []; };\n return RouterTestingModule;\n}());\n\nexports.SpyNgModuleFactoryLoader = SpyNgModuleFactoryLoader;\nexports.setupTestingRouter = setupTestingRouter;\nexports.RouterTestingModule = RouterTestingModule;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=router-testing.umd.js.map\n"]}
|
|
1
|
+
{"version":3,"sources":["router-testing.umd.js"],"names":["global","factory","exports","module","require","define","amd","ng","router","testing","common","core","this","_angular_common","_angular_common_testing","_angular_core","_angular_router","isUrlHandlingStrategy","opts","setupTestingRouter","urlSerializer","contexts","location","loader","compiler","injector","routes","urlHandlingStrategy","Router","ɵflatten","paramsInheritanceStrategy","SpyNgModuleFactoryLoader","_stubbedModules","Object","defineProperty","prototype","get","set","modules","res","_i","_a","keys","length","t","compileModuleAsync","enumerable","configurable","load","path","Promise","reject","Error","decorators","type","Injectable","ctorParameters","Compiler","RouterTestingModule","withRoutes","config","ngModule","providers","provideRoutes","provide","ROUTER_CONFIGURATION","useValue","NgModule","args","RouterModule","ɵROUTER_PROVIDERS","Location","useClass","SpyLocation","LocationStrategy","MockLocationStrategy","NgModuleFactoryLoader","useFactory","deps","UrlSerializer","ChildrenOutletContexts","Injector","ROUTES","UrlHandlingStrategy","Optional","PreloadingStrategy","useExisting","NoPreloading","value"],"mappings":";;;;;CAKC,SAAUA,OAAQC,SACC,gBAAZC,UAA0C,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file":"router-testing.umd.min.js","sourcesContent":["/**\n * @license Angular v5.2.8\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/common/testing'), require('@angular/core'), require('@angular/router')) :\n\ttypeof define === 'function' && define.amd ? define('@angular/router/testing', ['exports', '@angular/common', '@angular/common/testing', '@angular/core', '@angular/router'], factory) :\n\t(factory((global.ng = global.ng || {}, global.ng.router = global.ng.router || {}, global.ng.router.testing = {}),global.ng.common,global.ng.common.testing,global.ng.core,global.ng.router));\n}(this, (function (exports,_angular_common,_angular_common_testing,_angular_core,_angular_router) { 'use strict';\n\n/**\n * @license Angular v5.2.8\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\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/**\n * \\@whatItDoes Allows to simulate the loading of ng modules in tests.\n *\n * \\@howToUse\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 * \\@stable\n */\nvar SpyNgModuleFactoryLoader = /** @class */ (function () {\n function SpyNgModuleFactoryLoader(compiler) {\n this.compiler = compiler;\n /**\n * \\@docsNotRequired\n */\n this._stubbedModules = {};\n }\n Object.defineProperty(SpyNgModuleFactoryLoader.prototype, \"stubbedModules\", {\n /**\n * @docsNotRequired\n */\n get: /**\n * \\@docsNotRequired\n * @return {?}\n */\n function () { return this._stubbedModules; },\n /**\n * @docsNotRequired\n */\n set: /**\n * \\@docsNotRequired\n * @param {?} modules\n * @return {?}\n */\n function (modules) {\n var /** @type {?} */ res = {};\n for (var _i = 0, _a = Object.keys(modules); _i < _a.length; _i++) {\n var t = _a[_i];\n res[t] = this.compiler.compileModuleAsync(modules[t]);\n }\n this._stubbedModules = res;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} path\n * @return {?}\n */\n SpyNgModuleFactoryLoader.prototype.load = /**\n * @param {?} path\n * @return {?}\n */\n function (path) {\n if (this._stubbedModules[path]) {\n return this._stubbedModules[path];\n }\n else {\n return /** @type {?} */ (Promise.reject(new Error(\"Cannot find module \" + path)));\n }\n };\n SpyNgModuleFactoryLoader.decorators = [\n { type: _angular_core.Injectable },\n ];\n /** @nocollapse */\n SpyNgModuleFactoryLoader.ctorParameters = function () { return [\n { type: _angular_core.Compiler, },\n ]; };\n return SpyNgModuleFactoryLoader;\n}());\n/**\n * @param {?} opts\n * @return {?}\n */\nfunction isUrlHandlingStrategy(opts) {\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 * Router setup factory function used for testing.\n *\n * \\@stable\n * @param {?} urlSerializer\n * @param {?} contexts\n * @param {?} location\n * @param {?} loader\n * @param {?} compiler\n * @param {?} injector\n * @param {?} routes\n * @param {?=} opts\n * @param {?=} urlHandlingStrategy\n * @return {?}\n */\nfunction setupTestingRouter(urlSerializer, contexts, location, loader, compiler, injector, routes, opts, urlHandlingStrategy) {\n var /** @type {?} */ router = new _angular_router.Router(/** @type {?} */ ((null)), urlSerializer, contexts, location, injector, loader, compiler, _angular_router.ɵflatten(routes));\n // Handle deprecated argument ordering.\n if (opts) {\n if (isUrlHandlingStrategy(opts)) {\n router.urlHandlingStrategy = opts;\n }\n else if (opts.paramsInheritanceStrategy) {\n router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;\n }\n }\n if (urlHandlingStrategy) {\n router.urlHandlingStrategy = urlHandlingStrategy;\n }\n return router;\n}\n/**\n * \\@whatItDoes Sets up the router to be used for testing.\n *\n * \\@howToUse\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 * \\@description\n *\n * The modules sets up the router to be used for testing.\n * It provides spy implementations of {\\@link Location}, {\\@link LocationStrategy}, and {\\@link\n * NgModuleFactoryLoader}.\n *\n * \\@stable\n */\nvar RouterTestingModule = /** @class */ (function () {\n function RouterTestingModule() {\n }\n /**\n * @param {?} routes\n * @param {?=} config\n * @return {?}\n */\n RouterTestingModule.withRoutes = /**\n * @param {?} routes\n * @param {?=} config\n * @return {?}\n */\n function (routes, config) {\n return {\n ngModule: RouterTestingModule,\n providers: [\n _angular_router.provideRoutes(routes),\n { provide: _angular_router.ROUTER_CONFIGURATION, useValue: config ? config : {} },\n ]\n };\n };\n RouterTestingModule.decorators = [\n { type: _angular_core.NgModule, args: [{\n exports: [_angular_router.RouterModule],\n providers: [\n _angular_router.ɵROUTER_PROVIDERS, { provide: _angular_common.Location, useClass: _angular_common_testing.SpyLocation },\n { provide: _angular_common.LocationStrategy, useClass: _angular_common_testing.MockLocationStrategy },\n { provide: _angular_core.NgModuleFactoryLoader, useClass: SpyNgModuleFactoryLoader }, {\n provide: _angular_router.Router,\n useFactory: setupTestingRouter,\n deps: [\n _angular_router.UrlSerializer, _angular_router.ChildrenOutletContexts, _angular_common.Location, _angular_core.NgModuleFactoryLoader, _angular_core.Compiler, _angular_core.Injector,\n _angular_router.ROUTES, _angular_router.ROUTER_CONFIGURATION, [_angular_router.UrlHandlingStrategy, new _angular_core.Optional()]\n ]\n },\n { provide: _angular_router.PreloadingStrategy, useExisting: _angular_router.NoPreloading }, _angular_router.provideRoutes([])\n ]\n },] },\n ];\n /** @nocollapse */\n RouterTestingModule.ctorParameters = function () { return []; };\n return RouterTestingModule;\n}());\n\nexports.SpyNgModuleFactoryLoader = SpyNgModuleFactoryLoader;\nexports.setupTestingRouter = setupTestingRouter;\nexports.RouterTestingModule = RouterTestingModule;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=router-testing.umd.js.map\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v5.2.
|
|
2
|
+
* @license Angular v5.2.8
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}(this, (function (exports,_angular_core,_angular_router,_angular_upgrade_static) { 'use strict';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @license Angular v5.2.
|
|
13
|
+
* @license Angular v5.2.8
|
|
14
14
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
15
15
|
* License: MIT
|
|
16
16
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v5.2.
|
|
2
|
+
* @license Angular v5.2.8
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("@angular/router"),require("@angular/upgrade/static")):"function"==typeof define&&define.amd?define("@angular/router/upgrade",["exports","@angular/core","@angular/router","@angular/upgrade/static"],factory):factory((global.ng=global.ng||{},global.ng.router=global.ng.router||{},global.ng.router.upgrade={}),global.ng.core,global.ng.router,global.ng.upgrade.static)}(this,function(exports,_angular_core,_angular_router,_angular_upgrade_static){"use strict";function locationSyncBootstrapListener(ngUpgrade){return function(){setUpLocationSync(ngUpgrade)}}function setUpLocationSync(ngUpgrade){if(!ngUpgrade.$injector)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 ");var router=ngUpgrade.injector.get(_angular_router.Router),url=document.createElement("a");ngUpgrade.$injector.get("$rootScope").$on("$locationChangeStart",function(_,next,__){url.href=next,router.navigateByUrl(url.pathname+url.search+url.hash)})}/**
|
|
7
|
-
* @license Angular v5.2.
|
|
7
|
+
* @license Angular v5.2.8
|
|
8
8
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
9
9
|
* License: MIT
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["router-upgrade.umd.js"],"names":["global","factory","exports","module","require","define","amd","ng","router","upgrade","core","static","this","_angular_core","_angular_router","_angular_upgrade_static","locationSyncBootstrapListener","ngUpgrade","setUpLocationSync","$injector","Error","injector","get","Router","url","document","createElement","$on","_","next","__","href","navigateByUrl","pathname","search","hash","RouterUpgradeInitializer","provide","APP_BOOTSTRAP_LISTENER","multi","useFactory","deps","UpgradeModule","Object","defineProperty","value"],"mappings":";;;;;CAKC,SAAUA,OAAQC,SACC,gBAAZC,UAA0C,mBAAXC,QAAyBF,QAAQC,QAASE,QAAQ,iBAAkBA,QAAQ,mBAAoBA,QAAQ,4BAC5H,kBAAXC,SAAyBA,OAAOC,IAAMD,OAAO,2BAA4B,UAAW,gBAAiB,kBAAmB,2BAA4BJ,SAC1JA,SAASD,OAAOO,GAAKP,OAAOO,OAAUP,OAAOO,GAAGC,OAASR,OAAOO,GAAGC,WAAcR,OAAOO,GAAGC,OAAOC,YAAcT,OAAOO,GAAGG,KAAKV,OAAOO,GAAGC,OAAOR,OAAOO,GAAGE,QAAQE,SAClKC,KAAM,SAAWV,QAAQW,cAAcC,gBAAgBC,yBAA2B,YAoDpF,SAASC,+BAA8BC,WACnC,MAAO,YAAcC,kBAAkBD,YAY3C,QAASC,mBAAkBD,WACvB,IAAKA,UAAUE,UACX,KAAM,IAAIC,OAAM,gNAEpB,IAAqBZ,QAASS,UAAUI,SAASC,IAAIR,gBAAgBS,QAChDC,IAAMC,SAASC,cAAc,IAClDT,WAAUE,UAAUG,IAAI,cACnBK,IAAI,uBAAwB,SAAUC,EAAGC,KAAMC,IAChDN,IAAIO,KAAOF,KACXrB,OAAOwB,cAAcR,IAAIS,SAAWT,IAAIU,OAASV,IAAIW;;;;;;;;;;;;AAjC7D,GAAIC,2BACAC,QAASxB,cAAcyB,uBACvBC,OAAO,EACPC,WAAYxB,8BACZyB,MAAO1B,wBAAwB2B,eAiCnCxC,SAAQkC,yBAA2BA,yBACnClC,QAAQc,8BAAgCA,8BACxCd,QAAQgB,kBAAoBA,kBAE5ByB,OAAOC,eAAe1C,QAAS,cAAgB2C,OAAO","file":"router-upgrade.umd.min.js","sourcesContent":["/**\n * @license Angular v5.2.
|
|
1
|
+
{"version":3,"sources":["router-upgrade.umd.js"],"names":["global","factory","exports","module","require","define","amd","ng","router","upgrade","core","static","this","_angular_core","_angular_router","_angular_upgrade_static","locationSyncBootstrapListener","ngUpgrade","setUpLocationSync","$injector","Error","injector","get","Router","url","document","createElement","$on","_","next","__","href","navigateByUrl","pathname","search","hash","RouterUpgradeInitializer","provide","APP_BOOTSTRAP_LISTENER","multi","useFactory","deps","UpgradeModule","Object","defineProperty","value"],"mappings":";;;;;CAKC,SAAUA,OAAQC,SACC,gBAAZC,UAA0C,mBAAXC,QAAyBF,QAAQC,QAASE,QAAQ,iBAAkBA,QAAQ,mBAAoBA,QAAQ,4BAC5H,kBAAXC,SAAyBA,OAAOC,IAAMD,OAAO,2BAA4B,UAAW,gBAAiB,kBAAmB,2BAA4BJ,SAC1JA,SAASD,OAAOO,GAAKP,OAAOO,OAAUP,OAAOO,GAAGC,OAASR,OAAOO,GAAGC,WAAcR,OAAOO,GAAGC,OAAOC,YAAcT,OAAOO,GAAGG,KAAKV,OAAOO,GAAGC,OAAOR,OAAOO,GAAGE,QAAQE,SAClKC,KAAM,SAAWV,QAAQW,cAAcC,gBAAgBC,yBAA2B,YAoDpF,SAASC,+BAA8BC,WACnC,MAAO,YAAcC,kBAAkBD,YAY3C,QAASC,mBAAkBD,WACvB,IAAKA,UAAUE,UACX,KAAM,IAAIC,OAAM,gNAEpB,IAAqBZ,QAASS,UAAUI,SAASC,IAAIR,gBAAgBS,QAChDC,IAAMC,SAASC,cAAc,IAClDT,WAAUE,UAAUG,IAAI,cACnBK,IAAI,uBAAwB,SAAUC,EAAGC,KAAMC,IAChDN,IAAIO,KAAOF,KACXrB,OAAOwB,cAAcR,IAAIS,SAAWT,IAAIU,OAASV,IAAIW;;;;;;;;;;;;AAjC7D,GAAIC,2BACAC,QAASxB,cAAcyB,uBACvBC,OAAO,EACPC,WAAYxB,8BACZyB,MAAO1B,wBAAwB2B,eAiCnCxC,SAAQkC,yBAA2BA,yBACnClC,QAAQc,8BAAgCA,8BACxCd,QAAQgB,kBAAoBA,kBAE5ByB,OAAOC,eAAe1C,QAAS,cAAgB2C,OAAO","file":"router-upgrade.umd.min.js","sourcesContent":["/**\n * @license Angular v5.2.8\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/router'), require('@angular/upgrade/static')) :\n\ttypeof define === 'function' && define.amd ? define('@angular/router/upgrade', ['exports', '@angular/core', '@angular/router', '@angular/upgrade/static'], factory) :\n\t(factory((global.ng = global.ng || {}, global.ng.router = global.ng.router || {}, global.ng.router.upgrade = {}),global.ng.core,global.ng.router,global.ng.upgrade.static));\n}(this, (function (exports,_angular_core,_angular_router,_angular_upgrade_static) { 'use strict';\n\n/**\n * @license Angular v5.2.8\n * (c) 2010-2018 Google, Inc. https://angular.io/\n * License: MIT\n */\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\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/**\n * \\@whatItDoes Creates an initializer that in addition to setting up the Angular\n * router sets up the ngRoute integration.\n *\n * \\@howToUse\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 * \\@experimental\n */\nvar RouterUpgradeInitializer = {\n provide: _angular_core.APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: locationSyncBootstrapListener,\n deps: [_angular_upgrade_static.UpgradeModule]\n};\n/**\n * \\@internal\n * @param {?} ngUpgrade\n * @return {?}\n */\nfunction locationSyncBootstrapListener(ngUpgrade) {\n return function () { setUpLocationSync(ngUpgrade); };\n}\n/**\n * \\@whatItDoes 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 * \\@experimental\n * @param {?} ngUpgrade\n * @return {?}\n */\nfunction setUpLocationSync(ngUpgrade) {\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 var /** @type {?} */ router = ngUpgrade.injector.get(_angular_router.Router);\n var /** @type {?} */ url = document.createElement('a');\n ngUpgrade.$injector.get('$rootScope')\n .$on('$locationChangeStart', function (_, next, __) {\n url.href = next;\n router.navigateByUrl(url.pathname + url.search + url.hash);\n });\n}\n\nexports.RouterUpgradeInitializer = RouterUpgradeInitializer;\nexports.locationSyncBootstrapListener = locationSyncBootstrapListener;\nexports.setUpLocationSync = setUpLocationSync;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=router-upgrade.umd.js.map\n"]}
|
package/bundles/router.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v5.2.
|
|
2
|
+
* @license Angular v5.2.8
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -44,7 +44,7 @@ var __assign = Object.assign || function __assign(t) {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* @license Angular v5.2.
|
|
47
|
+
* @license Angular v5.2.8
|
|
48
48
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
49
49
|
* License: MIT
|
|
50
50
|
*/
|
|
@@ -722,6 +722,14 @@ function getFullPath(parentPath, currentRoute) {
|
|
|
722
722
|
return parentPath + "/" + currentRoute.path;
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
|
+
/**
|
|
726
|
+
* @param {?} r
|
|
727
|
+
* @return {?}
|
|
728
|
+
*/
|
|
729
|
+
function copyConfig(r) {
|
|
730
|
+
var /** @type {?} */ children = r.children && r.children.map(copyConfig);
|
|
731
|
+
return children ? __assign({}, r, { children: children }) : __assign({}, r);
|
|
732
|
+
}
|
|
725
733
|
|
|
726
734
|
/**
|
|
727
735
|
* @fileoverview added by tsickle
|
|
@@ -1239,7 +1247,7 @@ var DefaultUrlSerializer = /** @class */ (function () {
|
|
|
1239
1247
|
function (tree) {
|
|
1240
1248
|
var /** @type {?} */ segment = "/" + serializeSegment(tree.root, true);
|
|
1241
1249
|
var /** @type {?} */ query = serializeQueryParams(tree.queryParams);
|
|
1242
|
-
var /** @type {?} */ fragment = typeof tree.fragment === "string" ? "#" +
|
|
1250
|
+
var /** @type {?} */ fragment = typeof tree.fragment === "string" ? "#" + encodeUriQuery((/** @type {?} */ ((tree.fragment)))) : '';
|
|
1243
1251
|
return "" + segment + query + fragment;
|
|
1244
1252
|
};
|
|
1245
1253
|
return DefaultUrlSerializer;
|
|
@@ -1284,9 +1292,10 @@ function serializeSegment(segment, root) {
|
|
|
1284
1292
|
}
|
|
1285
1293
|
}
|
|
1286
1294
|
/**
|
|
1287
|
-
*
|
|
1288
|
-
*
|
|
1289
|
-
*
|
|
1295
|
+
* Encodes a URI string with the default encoding. This function will only ever be called from
|
|
1296
|
+
* `encodeUriQuery` or `encodeUriSegment` as it's the base set of encodings to be used. We need
|
|
1297
|
+
* a custom encoding because encodeURIComponent is too aggressive and encodes stuff that doesn't
|
|
1298
|
+
* have to be encoded per http://tools.ietf.org/html/rfc3986:
|
|
1290
1299
|
* query = *( pchar / "/" / "?" )
|
|
1291
1300
|
* pchar = unreserved / pct-encoded / sub-delims / ":" / "\@"
|
|
1292
1301
|
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
@@ -1296,13 +1305,35 @@ function serializeSegment(segment, root) {
|
|
|
1296
1305
|
* @param {?} s
|
|
1297
1306
|
* @return {?}
|
|
1298
1307
|
*/
|
|
1299
|
-
function
|
|
1308
|
+
function encodeUriString(s) {
|
|
1300
1309
|
return encodeURIComponent(s)
|
|
1301
1310
|
.replace(/%40/g, '@')
|
|
1302
1311
|
.replace(/%3A/gi, ':')
|
|
1303
1312
|
.replace(/%24/g, '$')
|
|
1304
|
-
.replace(/%2C/gi, ',')
|
|
1305
|
-
|
|
1313
|
+
.replace(/%2C/gi, ',');
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* This function should be used to encode both keys and values in a query string key/value or the
|
|
1317
|
+
* URL fragment. In the following URL, you need to call encodeUriQuery on "k", "v" and "f":
|
|
1318
|
+
*
|
|
1319
|
+
* http://www.site.org/html;mk=mv?k=v#f
|
|
1320
|
+
* @param {?} s
|
|
1321
|
+
* @return {?}
|
|
1322
|
+
*/
|
|
1323
|
+
function encodeUriQuery(s) {
|
|
1324
|
+
return encodeUriString(s).replace(/%3B/gi, ';');
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* This function should be run on any URI segment as well as the key and value in a key/value
|
|
1328
|
+
* pair for matrix params. In the following URL, you need to call encodeUriSegment on "html",
|
|
1329
|
+
* "mk", and "mv":
|
|
1330
|
+
*
|
|
1331
|
+
* http://www.site.org/html;mk=mv?k=v#f
|
|
1332
|
+
* @param {?} s
|
|
1333
|
+
* @return {?}
|
|
1334
|
+
*/
|
|
1335
|
+
function encodeUriSegment(s) {
|
|
1336
|
+
return encodeUriString(s).replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/%26/gi, '&');
|
|
1306
1337
|
}
|
|
1307
1338
|
/**
|
|
1308
1339
|
* @param {?} s
|
|
@@ -1311,19 +1342,28 @@ function encode(s) {
|
|
|
1311
1342
|
function decode(s) {
|
|
1312
1343
|
return decodeURIComponent(s);
|
|
1313
1344
|
}
|
|
1345
|
+
/**
|
|
1346
|
+
* @param {?} s
|
|
1347
|
+
* @return {?}
|
|
1348
|
+
*/
|
|
1349
|
+
function decodeQuery(s) {
|
|
1350
|
+
return decode(s.replace(/\+/g, '%20'));
|
|
1351
|
+
}
|
|
1314
1352
|
/**
|
|
1315
1353
|
* @param {?} path
|
|
1316
1354
|
* @return {?}
|
|
1317
1355
|
*/
|
|
1318
1356
|
function serializePath(path) {
|
|
1319
|
-
return "" +
|
|
1357
|
+
return "" + encodeUriSegment(path.path) + serializeMatrixParams(path.parameters);
|
|
1320
1358
|
}
|
|
1321
1359
|
/**
|
|
1322
1360
|
* @param {?} params
|
|
1323
1361
|
* @return {?}
|
|
1324
1362
|
*/
|
|
1325
|
-
function
|
|
1326
|
-
return Object.keys(params)
|
|
1363
|
+
function serializeMatrixParams(params) {
|
|
1364
|
+
return Object.keys(params)
|
|
1365
|
+
.map(function (key) { return ";" + encodeUriSegment(key) + "=" + encodeUriSegment(params[key]); })
|
|
1366
|
+
.join('');
|
|
1327
1367
|
}
|
|
1328
1368
|
/**
|
|
1329
1369
|
* @param {?} params
|
|
@@ -1332,8 +1372,9 @@ function serializeParams(params) {
|
|
|
1332
1372
|
function serializeQueryParams(params) {
|
|
1333
1373
|
var /** @type {?} */ strParams = Object.keys(params).map(function (name) {
|
|
1334
1374
|
var /** @type {?} */ value = params[name];
|
|
1335
|
-
return Array.isArray(value) ?
|
|
1336
|
-
|
|
1375
|
+
return Array.isArray(value) ?
|
|
1376
|
+
value.map(function (v) { return encodeUriQuery(name) + "=" + encodeUriQuery(v); }).join('&') :
|
|
1377
|
+
encodeUriQuery(name) + "=" + encodeUriQuery(value);
|
|
1337
1378
|
});
|
|
1338
1379
|
return strParams.length ? "?" + strParams.join("&") : '';
|
|
1339
1380
|
}
|
|
@@ -1405,7 +1446,7 @@ var UrlParser = /** @class */ (function () {
|
|
|
1405
1446
|
* @return {?}
|
|
1406
1447
|
*/
|
|
1407
1448
|
function () {
|
|
1408
|
-
return this.consumeOptional('#') ?
|
|
1449
|
+
return this.consumeOptional('#') ? decodeURIComponent(this.remaining) : null;
|
|
1409
1450
|
};
|
|
1410
1451
|
/**
|
|
1411
1452
|
* @return {?}
|
|
@@ -1513,8 +1554,8 @@ var UrlParser = /** @class */ (function () {
|
|
|
1513
1554
|
this.capture(value);
|
|
1514
1555
|
}
|
|
1515
1556
|
}
|
|
1516
|
-
var /** @type {?} */ decodedKey =
|
|
1517
|
-
var /** @type {?} */ decodedVal =
|
|
1557
|
+
var /** @type {?} */ decodedKey = decodeQuery(key);
|
|
1558
|
+
var /** @type {?} */ decodedVal = decodeQuery(value);
|
|
1518
1559
|
if (params.hasOwnProperty(decodedKey)) {
|
|
1519
1560
|
// Append to existing values
|
|
1520
1561
|
var /** @type {?} */ currentVal = params[decodedKey];
|
|
@@ -4548,7 +4589,7 @@ var RouterConfigLoader = /** @class */ (function () {
|
|
|
4548
4589
|
_this.onLoadEndListener(route);
|
|
4549
4590
|
}
|
|
4550
4591
|
var /** @type {?} */ module = factory.create(parentInjector);
|
|
4551
|
-
return new LoadedRouterConfig(flatten(module.injector.get(ROUTES)), module);
|
|
4592
|
+
return new LoadedRouterConfig(flatten(module.injector.get(ROUTES)).map(copyConfig), module);
|
|
4552
4593
|
});
|
|
4553
4594
|
};
|
|
4554
4595
|
/**
|
|
@@ -4878,7 +4919,7 @@ var Router = /** @class */ (function () {
|
|
|
4878
4919
|
*/
|
|
4879
4920
|
function (config) {
|
|
4880
4921
|
validateConfig(config);
|
|
4881
|
-
this.config = config;
|
|
4922
|
+
this.config = config.map(copyConfig);
|
|
4882
4923
|
this.navigated = false;
|
|
4883
4924
|
};
|
|
4884
4925
|
/** @docsNotRequired */
|
|
@@ -5472,67 +5513,99 @@ var Router = /** @class */ (function () {
|
|
|
5472
5513
|
return { appliedUrl: appliedUrl, state: null, shouldActivate: shouldActivate };
|
|
5473
5514
|
}
|
|
5474
5515
|
});
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5516
|
+
_this.activateRoutes(routerState$, _this.routerState, _this.currentUrlTree, id, url, rawUrl, skipLocationChange, replaceUrl, resolvePromise, rejectPromise);
|
|
5517
|
+
});
|
|
5518
|
+
};
|
|
5519
|
+
/**
|
|
5520
|
+
* Performs the logic of activating routes. This is a synchronous process by default. While this
|
|
5521
|
+
* is a private method, it could be overridden to make activation asynchronous.
|
|
5522
|
+
* @param {?} state
|
|
5523
|
+
* @param {?} storedState
|
|
5524
|
+
* @param {?} storedUrl
|
|
5525
|
+
* @param {?} id
|
|
5526
|
+
* @param {?} url
|
|
5527
|
+
* @param {?} rawUrl
|
|
5528
|
+
* @param {?} skipLocationChange
|
|
5529
|
+
* @param {?} replaceUrl
|
|
5530
|
+
* @param {?} resolvePromise
|
|
5531
|
+
* @param {?} rejectPromise
|
|
5532
|
+
* @return {?}
|
|
5533
|
+
*/
|
|
5534
|
+
Router.prototype.activateRoutes = /**
|
|
5535
|
+
* Performs the logic of activating routes. This is a synchronous process by default. While this
|
|
5536
|
+
* is a private method, it could be overridden to make activation asynchronous.
|
|
5537
|
+
* @param {?} state
|
|
5538
|
+
* @param {?} storedState
|
|
5539
|
+
* @param {?} storedUrl
|
|
5540
|
+
* @param {?} id
|
|
5541
|
+
* @param {?} url
|
|
5542
|
+
* @param {?} rawUrl
|
|
5543
|
+
* @param {?} skipLocationChange
|
|
5544
|
+
* @param {?} replaceUrl
|
|
5545
|
+
* @param {?} resolvePromise
|
|
5546
|
+
* @param {?} rejectPromise
|
|
5547
|
+
* @return {?}
|
|
5548
|
+
*/
|
|
5549
|
+
function (state, storedState, storedUrl, id, url, rawUrl, skipLocationChange, replaceUrl, resolvePromise, rejectPromise) {
|
|
5550
|
+
var _this = this;
|
|
5551
|
+
// applied the new router state
|
|
5552
|
+
// this operation has side effects
|
|
5553
|
+
var /** @type {?} */ navigationIsSuccessful;
|
|
5554
|
+
state
|
|
5555
|
+
.forEach(function (_a) {
|
|
5556
|
+
var appliedUrl = _a.appliedUrl, state = _a.state, shouldActivate = _a.shouldActivate;
|
|
5557
|
+
if (!shouldActivate || id !== _this.navigationId) {
|
|
5558
|
+
navigationIsSuccessful = false;
|
|
5559
|
+
return;
|
|
5560
|
+
}
|
|
5561
|
+
_this.currentUrlTree = appliedUrl;
|
|
5562
|
+
_this.rawUrlTree = _this.urlHandlingStrategy.merge(_this.currentUrlTree, rawUrl);
|
|
5563
|
+
(/** @type {?} */ (_this)).routerState = state;
|
|
5564
|
+
if (!skipLocationChange) {
|
|
5565
|
+
var /** @type {?} */ path = _this.urlSerializer.serialize(_this.rawUrlTree);
|
|
5566
|
+
if (_this.location.isCurrentPathEqualTo(path) || replaceUrl) {
|
|
5567
|
+
_this.location.replaceState(path);
|
|
5509
5568
|
}
|
|
5510
5569
|
else {
|
|
5511
|
-
_this.
|
|
5512
|
-
(/** @type {?} */ (_this.events))
|
|
5513
|
-
.next(new NavigationCancel(id, _this.serializeUrl(url), ''));
|
|
5514
|
-
resolvePromise(false);
|
|
5570
|
+
_this.location.go(path);
|
|
5515
5571
|
}
|
|
5516
|
-
}
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5572
|
+
}
|
|
5573
|
+
new ActivateRoutes(_this.routeReuseStrategy, state, storedState, function (evt) { return _this.triggerEvent(evt); })
|
|
5574
|
+
.activate(_this.rootContexts);
|
|
5575
|
+
navigationIsSuccessful = true;
|
|
5576
|
+
})
|
|
5577
|
+
.then(function () {
|
|
5578
|
+
if (navigationIsSuccessful) {
|
|
5579
|
+
_this.navigated = true;
|
|
5580
|
+
(/** @type {?} */ (_this.events))
|
|
5581
|
+
.next(new NavigationEnd(id, _this.serializeUrl(url), _this.serializeUrl(_this.currentUrlTree)));
|
|
5582
|
+
resolvePromise(true);
|
|
5583
|
+
}
|
|
5584
|
+
else {
|
|
5585
|
+
_this.resetUrlToCurrentUrlTree();
|
|
5586
|
+
(/** @type {?} */ (_this.events))
|
|
5587
|
+
.next(new NavigationCancel(id, _this.serializeUrl(url), ''));
|
|
5588
|
+
resolvePromise(false);
|
|
5589
|
+
}
|
|
5590
|
+
}, function (e) {
|
|
5591
|
+
if (isNavigationCancelingError(e)) {
|
|
5592
|
+
_this.navigated = true;
|
|
5593
|
+
_this.resetStateAndUrl(storedState, storedUrl, rawUrl);
|
|
5594
|
+
(/** @type {?} */ (_this.events))
|
|
5595
|
+
.next(new NavigationCancel(id, _this.serializeUrl(url), e.message));
|
|
5596
|
+
resolvePromise(false);
|
|
5597
|
+
}
|
|
5598
|
+
else {
|
|
5599
|
+
_this.resetStateAndUrl(storedState, storedUrl, rawUrl);
|
|
5600
|
+
(/** @type {?} */ (_this.events))
|
|
5601
|
+
.next(new NavigationError(id, _this.serializeUrl(url), e));
|
|
5602
|
+
try {
|
|
5603
|
+
resolvePromise(_this.errorHandler(e));
|
|
5523
5604
|
}
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
(/** @type {?} */ (_this.events))
|
|
5527
|
-
.next(new NavigationError(id, _this.serializeUrl(url), e));
|
|
5528
|
-
try {
|
|
5529
|
-
resolvePromise(_this.errorHandler(e));
|
|
5530
|
-
}
|
|
5531
|
-
catch (/** @type {?} */ ee) {
|
|
5532
|
-
rejectPromise(ee);
|
|
5533
|
-
}
|
|
5605
|
+
catch (/** @type {?} */ ee) {
|
|
5606
|
+
rejectPromise(ee);
|
|
5534
5607
|
}
|
|
5535
|
-
}
|
|
5608
|
+
}
|
|
5536
5609
|
});
|
|
5537
5610
|
};
|
|
5538
5611
|
/**
|
|
@@ -7427,7 +7500,7 @@ function provideRouterInitializer() {
|
|
|
7427
7500
|
/**
|
|
7428
7501
|
* \@stable
|
|
7429
7502
|
*/
|
|
7430
|
-
var VERSION = new _angular_core.Version('5.2.
|
|
7503
|
+
var VERSION = new _angular_core.Version('5.2.8');
|
|
7431
7504
|
|
|
7432
7505
|
exports.RouterLink = RouterLink;
|
|
7433
7506
|
exports.RouterLinkWithHref = RouterLinkWithHref;
|