@angular/router 10.0.4 → 10.0.5
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 +1 -1
- package/bundles/router-testing.umd.min.js +1 -1
- package/bundles/router-testing.umd.min.js.map +1 -1
- package/bundles/router-upgrade.umd.js +1 -1
- package/bundles/router-upgrade.umd.min.js +1 -1
- package/bundles/router-upgrade.umd.min.js.map +1 -1
- package/bundles/router.umd.js +111 -77
- package/bundles/router.umd.js.map +1 -1
- package/bundles/router.umd.min.js +2 -2
- package/bundles/router.umd.min.js.map +1 -1
- package/esm2015/src/config.js +1 -1
- package/esm2015/src/events.js +29 -7
- package/esm2015/src/interfaces.js +1 -1
- package/esm2015/src/router.js +32 -23
- package/esm2015/src/router_module.js +38 -45
- package/esm2015/src/router_state.js +14 -4
- package/esm2015/src/version.js +1 -1
- package/fesm2015/router.js +111 -77
- package/fesm2015/router.js.map +1 -1
- package/fesm2015/testing.js +1 -1
- package/fesm2015/upgrade.js +1 -1
- package/package.json +4 -4
- package/router.d.ts +308 -152
- package/router.metadata.json +1 -1
- package/testing/testing.d.ts +1 -1
- package/testing.d.ts +1 -1
- package/upgrade/upgrade.d.ts +1 -1
- package/upgrade.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/router/router-testing.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","router","testing","common","core","this","SpyNgModuleFactoryLoader","compiler","_stubbedModules","Object","defineProperty","prototype","get","set","modules","e_1","_a","res","_b","__values","o","s","Symbol","iterator","m","i","call","length","next","value","done","TypeError","keys","_c","t","compileModuleAsync","e_1_1","error","return","enumerable","configurable","load","path","Promise","reject","Error","setupTestingRouter","urlSerializer","contexts","location","loader","injector","routes","opts","urlHandlingStrategy","router$1","Router","ɵflatten","isUrlHandlingStrategy","malformedUriErrorHandler","paramsInheritanceStrategy","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"],"mappings":";;;;;CAMC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,mBAAoBA,QAAQ,2BAA4BA,QAAQ,iBAAkBA,QAAQ,oBAChK,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,0BAA2B,CAAC,UAAW,kBAAmB,0BAA2B,gBAAiB,mBAAoBJ,GACpJA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,OAAST,EAAOQ,GAAGC,QAAU,GAAIT,EAAOQ,GAAGC,OAAOC,QAAU,IAAKV,EAAOQ,GAAGG,OAAQX,EAAOQ,GAAGG,OAAOD,QAASV,EAAOQ,GAAGI,KAAMZ,EAAOQ,GAAGC,QAHrN,CAIEI,MAAM,SAAWX,EAASS,EAAQD,EAASE,EAAMH,GAAU;;;;;;;;;;;;;;oFA4UzD,IAAIK,EAA0C,WAC1C,SAASA,EAAyBC,GAC9BF,KAAKE,SAAWA,EAIhBF,KAAKG,gBAAkB,GAyC3B,OAvCAC,OAAOC,eAAeJ,EAAyBK,UAAW,iBAAkB,CAIxEC,IAAK,WACD,OAAOP,KAAKG,iBAKhBK,IAAK,SAAUC,GACX,IAAIC,EAAKC,EACLC,EAAM,GACV,IACI,IAAK,IAAIC,EArLzB,SAASC,EAASC,GACd,IAAIC,EAAsB,mBAAXC,QAAyBA,OAAOC,SAAUC,EAAIH,GAAKD,EAAEC,GAAII,EAAI,EAC5E,GAAID,EACA,OAAOA,EAAEE,KAAKN,GAClB,GAAIA,GAAyB,iBAAbA,EAA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c,MAAO,CAC3D,CAAEF,KAAM1D,EAAK6D,YA4DjB,IAAIC,EAAqC,WACrC,SAASA,KAWT,OATAA,EAAoBC,WAAa,SAAUf,EAAQgB,GAC/C,MAAO,CACHC,SAAUH,EACVI,UAAW,CACPrE,EAAOsE,cAAcnB,GACrB,CAAEoB,QAASvE,EAAOwE,qBAAsBC,SAAUN,GAAkB,OAIzEF,EAZ6B,GAcxCA,EAAoBL,WAAa,CAC7B,CAAEC,KAAM1D,EAAKuE,SAAUC,KAAM,CAAC,CAClBlF,QAAS,CAACO,EAAO4E,cACjBP,UAAW,CACPrE,EAAO6E,kBAAmB,CAAEN,QAASrE,EAAO4E,SAAUC,SAAU9E,EAAQ+E,aACxE,CAAET,QAASrE,EAAO+E,iBAAkBF,SAAU9E,EAAQiF,sBACtD,CAAEX,QAASpE,EAAKgF,sBAAuBJ,SAAU1E,GAA4B,CACzEkE,QAASvE,EAAOuD,OAChB6B,WAAYvC,EACZwC,KAAM,CACFrF,EAAOsF,cAAetF,EAAOuF,uBAAwBrF,EAAO4E,SAAU3E,EAAKgF,sBAAuBhF,EAAK6D,SAAU7D,EAAKqF,SACtHxF,EAAOyF,OAAQzF,EAAOwE,qBAAsB,CAACxE,EAAO0F,oBAAqB,IAAIvF,EAAKwF,YAG1F,CAAEpB,QAASvE,EAAO4F,mBAAoBC,YAAa7F,EAAO8F,cAAgB9F,EAAOsE,cAAc;;;;;;;;;;;;;;;;;;;;;;AAkCnH7E,EAAQwE,oBAAsBA,EAC9BxE,EAAQY,yBAA2BA,EACnCZ,EAAQoD,mBAAqBA,EAE7BrC,OAAOC,eAAehB,EAAS,aAAc,CAAEmC,OAAO","sourcesContent":["/**\n * @license Angular v10.0.4\n * (c) 2010-2020 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/common/testing'), require('@angular/core'), require('@angular/router')) :\n typeof define === 'function' && define.amd ? define('@angular/router/testing', ['exports', '@angular/common', '@angular/common/testing', '@angular/core', '@angular/router'], factory) :\n (global = global || self, 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, common, testing, core, router) { 'use strict';\n\n /*! *****************************************************************************\n Copyright (c) Microsoft Corporation.\n\n Permission to use, copy, modify, and/or distribute this software for any\n purpose with or without fee is hereby granted.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n PERFORMANCE OF THIS SOFTWARE.\n ***************************************************************************** */\n /* global Reflect, Promise */\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b)\n if (b.hasOwnProperty(p))\n d[p] = b[p]; };\n return extendStatics(d, b);\n };\n function __extends(d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n }\n var __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __rest(s, e) {\n var t = {};\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n }\n function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\")\n r = Reflect.decorate(decorators, target, key, desc);\n else\n for (var i = decorators.length - 1; i >= 0; i--)\n if (d = decorators[i])\n r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n }\n function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); };\n }\n function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\")\n return Reflect.metadata(metadataKey, metadataValue);\n }\n function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try {\n step(generator.next(value));\n }\n catch (e) {\n reject(e);\n } }\n function rejected(value) { try {\n step(generator[\"throw\"](value));\n }\n catch (e) {\n reject(e);\n } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n }\n function __generator(thisArg, body) {\n var _ = { label: 0, sent: function () { if (t[0] & 1)\n throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f)\n throw new TypeError(\"Generator is already executing.\");\n while (_)\n try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)\n return t;\n if (y = 0, t)\n op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return { value: op[1], done: false };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2])\n _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n }\n catch (e) {\n op = [6, e];\n y = 0;\n }\n finally {\n f = t = 0;\n }\n if (op[0] & 5)\n throw op[1];\n return { value: op[0] ? op[1] : void 0, done: true };\n }\n }\n var __createBinding = Object.create ? (function (o, m, k, k2) {\n if (k2 === undefined)\n k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });\n }) : (function (o, m, k, k2) {\n if (k2 === undefined)\n k2 = k;\n o[k2] = m[k];\n });\n function __exportStar(m, exports) {\n for (var p in m)\n if (p !== \"default\" && !exports.hasOwnProperty(p))\n __createBinding(exports, m, p);\n }\n function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m)\n return m.call(o);\n if (o && typeof o.length === \"number\")\n return {\n next: function () {\n if (o && i >= o.length)\n o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n }\n function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m)\n return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done)\n ar.push(r.value);\n }\n catch (error) {\n e = { error: error };\n }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"]))\n m.call(i);\n }\n finally {\n if (e)\n throw e.error;\n }\n }\n return ar;\n }\n function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n }\n function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n }\n ;\n function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n }\n function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator)\n throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n])\n i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try {\n step(g[n](v));\n }\n catch (e) {\n settle(q[0][3], e);\n } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length)\n resume(q[0][0], q[0][1]); }\n }\n function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\n }\n function __asyncValues(o) {\n if (!Symbol.asyncIterator)\n throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }\n }\n function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", { value: raw });\n }\n else {\n cooked.raw = raw;\n }\n return cooked;\n }\n ;\n var __setModuleDefault = Object.create ? (function (o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n }) : function (o, v) {\n o[\"default\"] = v;\n };\n function __importStar(mod) {\n if (mod && mod.__esModule)\n return mod;\n var result = {};\n if (mod != null)\n for (var k in mod)\n if (Object.hasOwnProperty.call(mod, k))\n __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n }\n function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n }\n function __classPrivateFieldGet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n }\n function __classPrivateFieldSet(receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n }\n\n /**\n * @description\n *\n * Allows to simulate the loading of ng modules in tests.\n *\n * ```\n * const loader = TestBed.inject(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 var 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: function () {\n return this._stubbedModules;\n },\n /**\n * @docsNotRequired\n */\n set: function (modules) {\n var e_1, _a;\n var res = {};\n try {\n for (var _b = __values(Object.keys(modules)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var t = _c.value;\n res[t] = this.compiler.compileModuleAsync(modules[t]);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n this._stubbedModules = res;\n },\n enumerable: false,\n configurable: true\n });\n SpyNgModuleFactoryLoader.prototype.load = function (path) {\n if (this._stubbedModules[path]) {\n return this._stubbedModules[path];\n }\n else {\n return Promise.reject(new Error(\"Cannot find module \" + path));\n }\n };\n return SpyNgModuleFactoryLoader;\n }());\n SpyNgModuleFactoryLoader.decorators = [\n { type: core.Injectable }\n ];\n SpyNgModuleFactoryLoader.ctorParameters = function () { return [\n { type: core.Compiler }\n ]; };\n function 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 * @publicApi\n */\n function setupTestingRouter(urlSerializer, contexts, location, loader, compiler, injector, routes, opts, urlHandlingStrategy) {\n var router$1 = new router.Router(null, urlSerializer, contexts, location, injector, loader, compiler, router.ɵflatten(routes));\n if (opts) {\n // Handle deprecated argument ordering.\n if (isUrlHandlingStrategy(opts)) {\n router$1.urlHandlingStrategy = opts;\n }\n else {\n // Handle ExtraOptions\n if (opts.malformedUriErrorHandler) {\n router$1.malformedUriErrorHandler = opts.malformedUriErrorHandler;\n }\n if (opts.paramsInheritanceStrategy) {\n router$1.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;\n }\n }\n }\n if (urlHandlingStrategy) {\n router$1.urlHandlingStrategy = urlHandlingStrategy;\n }\n return router$1;\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.configureTestingModule({\n * imports: [\n * RouterTestingModule.withRoutes(\n * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]\n * )\n * ]\n * });\n * });\n * ```\n *\n * @publicApi\n */\n var RouterTestingModule = /** @class */ (function () {\n function RouterTestingModule() {\n }\n RouterTestingModule.withRoutes = function (routes, config) {\n return {\n ngModule: RouterTestingModule,\n providers: [\n router.provideRoutes(routes),\n { provide: router.ROUTER_CONFIGURATION, useValue: config ? config : {} },\n ]\n };\n };\n return RouterTestingModule;\n }());\n RouterTestingModule.decorators = [\n { type: core.NgModule, args: [{\n exports: [router.RouterModule],\n providers: [\n router.ɵROUTER_PROVIDERS, { provide: common.Location, useClass: testing.SpyLocation },\n { provide: common.LocationStrategy, useClass: testing.MockLocationStrategy },\n { provide: core.NgModuleFactoryLoader, useClass: SpyNgModuleFactoryLoader }, {\n provide: router.Router,\n useFactory: setupTestingRouter,\n deps: [\n router.UrlSerializer, router.ChildrenOutletContexts, common.Location, core.NgModuleFactoryLoader, core.Compiler, core.Injector,\n router.ROUTES, router.ROUTER_CONFIGURATION, [router.UrlHandlingStrategy, new core.Optional()]\n ]\n },\n { provide: router.PreloadingStrategy, useExisting: router.NoPreloading }, router.provideRoutes([])\n ]\n },] }\n ];\n\n /**\n * @license\n * Copyright Google LLC 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 /**\n * @license\n * Copyright Google LLC 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 // This file only reexports content of the `src` folder. Keep it that way.\n\n /**\n * @license\n * Copyright Google LLC 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 /**\n * Generated bundle index. Do not edit.\n */\n\n exports.RouterTestingModule = RouterTestingModule;\n exports.SpyNgModuleFactoryLoader = SpyNgModuleFactoryLoader;\n exports.setupTestingRouter = setupTestingRouter;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=router-testing.umd.js.map\n"]}
|
|
1
|
+
{"version":3,"sources":["packages/router/router-testing.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","router","testing","common","core","this","SpyNgModuleFactoryLoader","compiler","_stubbedModules","Object","defineProperty","prototype","get","set","modules","e_1","_a","res","_b","__values","o","s","Symbol","iterator","m","i","call","length","next","value","done","TypeError","keys","_c","t","compileModuleAsync","e_1_1","error","return","enumerable","configurable","load","path","Promise","reject","Error","setupTestingRouter","urlSerializer","contexts","location","loader","injector","routes","opts","urlHandlingStrategy","router$1","Router","ɵflatten","isUrlHandlingStrategy","malformedUriErrorHandler","paramsInheritanceStrategy","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","Ch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AOsE,cAAcnB,GACrB,CAAEoB,QAASvE,EAAOwE,qBAAsBC,SAAUN,GAAkB,OAIzEF,EAZ6B,GAcxCA,EAAoBL,WAAa,CAC7B,CAAEC,KAAM1D,EAAKuE,SAAUC,KAAM,CAAC,CAClBlF,QAAS,CAACO,EAAO4E,cACjBP,UAAW,CACPrE,EAAO6E,kBAAmB,CAAEN,QAASrE,EAAO4E,SAAUC,SAAU9E,EAAQ+E,aACxE,CAAET,QAASrE,EAAO+E,iBAAkBF,SAAU9E,EAAQiF,sBACtD,CAAEX,QAASpE,EAAKgF,sBAAuBJ,SAAU1E,GAA4B,CACzEkE,QAASvE,EAAOuD,OAChB6B,WAAYvC,EACZwC,KAAM,CACFrF,EAAOsF,cAAetF,EAAOuF,uBAAwBrF,EAAO4E,SAAU3E,EAAKgF,sBAAuBhF,EAAK6D,SAAU7D,EAAKqF,SACtHxF,EAAOyF,OAAQzF,EAAOwE,qBAAsB,CAACxE,EAAO0F,oBAAqB,IAAIvF,EAAKwF,YAG1F,CAAEpB,QAASvE,EAAO4F,mBAAoBC,YAAa7F,EAAO8F,cAAgB9F,EAAOsE,cAAc;;;;;;;;;;;;;;;;;;;;;;AAkCnH7E,EAAQwE,oBAAsBA,EAC9BxE,EAAQY,yBAA2BA,EACnCZ,EAAQoD,mBAAqBA,EAE7BrC,OAAOC,eAAehB,EAAS,aAAc,CAAEmC,OAAO","sourcesContent":["/**\n * @license Angular v10.0.5\n * (c) 2010-2020 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/common/testing'), require('@angular/core'), require('@angular/router')) :\n typeof define === 'function' && define.amd ? define('@angular/router/testing', ['exports', '@angular/common', '@angular/common/testing', '@angular/core', '@angular/router'], factory) :\n (global = global || self, 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, common, testing, core, router) { 'use strict';\n\n /*! *****************************************************************************\n Copyright (c) Microsoft Corporation.\n\n Permission to use, copy, modify, and/or distribute this software for any\n purpose with or without fee is hereby granted.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n PERFORMANCE OF THIS SOFTWARE.\n ***************************************************************************** */\n /* global Reflect, Promise */\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b)\n if (b.hasOwnProperty(p))\n d[p] = b[p]; };\n return extendStatics(d, b);\n };\n function __extends(d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n }\n var __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __rest(s, e) {\n var t = {};\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n }\n function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\")\n r = Reflect.decorate(decorators, target, key, desc);\n else\n for (var i = decorators.length - 1; i >= 0; i--)\n if (d = decorators[i])\n r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n }\n function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); };\n }\n function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\")\n return Reflect.metadata(metadataKey, metadataValue);\n }\n function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try {\n step(generator.next(value));\n }\n catch (e) {\n reject(e);\n } }\n function rejected(value) { try {\n step(generator[\"throw\"](value));\n }\n catch (e) {\n reject(e);\n } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n }\n function __generator(thisArg, body) {\n var _ = { label: 0, sent: function () { if (t[0] & 1)\n throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f)\n throw new TypeError(\"Generator is already executing.\");\n while (_)\n try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)\n return t;\n if (y = 0, t)\n op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return { value: op[1], done: false };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2])\n _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n }\n catch (e) {\n op = [6, e];\n y = 0;\n }\n finally {\n f = t = 0;\n }\n if (op[0] & 5)\n throw op[1];\n return { value: op[0] ? op[1] : void 0, done: true };\n }\n }\n var __createBinding = Object.create ? (function (o, m, k, k2) {\n if (k2 === undefined)\n k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });\n }) : (function (o, m, k, k2) {\n if (k2 === undefined)\n k2 = k;\n o[k2] = m[k];\n });\n function __exportStar(m, exports) {\n for (var p in m)\n if (p !== \"default\" && !exports.hasOwnProperty(p))\n __createBinding(exports, m, p);\n }\n function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m)\n return m.call(o);\n if (o && typeof o.length === \"number\")\n return {\n next: function () {\n if (o && i >= o.length)\n o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n }\n function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m)\n return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done)\n ar.push(r.value);\n }\n catch (error) {\n e = { error: error };\n }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"]))\n m.call(i);\n }\n finally {\n if (e)\n throw e.error;\n }\n }\n return ar;\n }\n function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n }\n function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n }\n ;\n function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n }\n function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator)\n throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n])\n i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try {\n step(g[n](v));\n }\n catch (e) {\n settle(q[0][3], e);\n } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length)\n resume(q[0][0], q[0][1]); }\n }\n function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\n }\n function __asyncValues(o) {\n if (!Symbol.asyncIterator)\n throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }\n }\n function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", { value: raw });\n }\n else {\n cooked.raw = raw;\n }\n return cooked;\n }\n ;\n var __setModuleDefault = Object.create ? (function (o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n }) : function (o, v) {\n o[\"default\"] = v;\n };\n function __importStar(mod) {\n if (mod && mod.__esModule)\n return mod;\n var result = {};\n if (mod != null)\n for (var k in mod)\n if (Object.hasOwnProperty.call(mod, k))\n __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n }\n function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n }\n function __classPrivateFieldGet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n }\n function __classPrivateFieldSet(receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n }\n\n /**\n * @description\n *\n * Allows to simulate the loading of ng modules in tests.\n *\n * ```\n * const loader = TestBed.inject(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 var 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: function () {\n return this._stubbedModules;\n },\n /**\n * @docsNotRequired\n */\n set: function (modules) {\n var e_1, _a;\n var res = {};\n try {\n for (var _b = __values(Object.keys(modules)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var t = _c.value;\n res[t] = this.compiler.compileModuleAsync(modules[t]);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n this._stubbedModules = res;\n },\n enumerable: false,\n configurable: true\n });\n SpyNgModuleFactoryLoader.prototype.load = function (path) {\n if (this._stubbedModules[path]) {\n return this._stubbedModules[path];\n }\n else {\n return Promise.reject(new Error(\"Cannot find module \" + path));\n }\n };\n return SpyNgModuleFactoryLoader;\n }());\n SpyNgModuleFactoryLoader.decorators = [\n { type: core.Injectable }\n ];\n SpyNgModuleFactoryLoader.ctorParameters = function () { return [\n { type: core.Compiler }\n ]; };\n function 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 * @publicApi\n */\n function setupTestingRouter(urlSerializer, contexts, location, loader, compiler, injector, routes, opts, urlHandlingStrategy) {\n var router$1 = new router.Router(null, urlSerializer, contexts, location, injector, loader, compiler, router.ɵflatten(routes));\n if (opts) {\n // Handle deprecated argument ordering.\n if (isUrlHandlingStrategy(opts)) {\n router$1.urlHandlingStrategy = opts;\n }\n else {\n // Handle ExtraOptions\n if (opts.malformedUriErrorHandler) {\n router$1.malformedUriErrorHandler = opts.malformedUriErrorHandler;\n }\n if (opts.paramsInheritanceStrategy) {\n router$1.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;\n }\n }\n }\n if (urlHandlingStrategy) {\n router$1.urlHandlingStrategy = urlHandlingStrategy;\n }\n return router$1;\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.configureTestingModule({\n * imports: [\n * RouterTestingModule.withRoutes(\n * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]\n * )\n * ]\n * });\n * });\n * ```\n *\n * @publicApi\n */\n var RouterTestingModule = /** @class */ (function () {\n function RouterTestingModule() {\n }\n RouterTestingModule.withRoutes = function (routes, config) {\n return {\n ngModule: RouterTestingModule,\n providers: [\n router.provideRoutes(routes),\n { provide: router.ROUTER_CONFIGURATION, useValue: config ? config : {} },\n ]\n };\n };\n return RouterTestingModule;\n }());\n RouterTestingModule.decorators = [\n { type: core.NgModule, args: [{\n exports: [router.RouterModule],\n providers: [\n router.ɵROUTER_PROVIDERS, { provide: common.Location, useClass: testing.SpyLocation },\n { provide: common.LocationStrategy, useClass: testing.MockLocationStrategy },\n { provide: core.NgModuleFactoryLoader, useClass: SpyNgModuleFactoryLoader }, {\n provide: router.Router,\n useFactory: setupTestingRouter,\n deps: [\n router.UrlSerializer, router.ChildrenOutletContexts, common.Location, core.NgModuleFactoryLoader, core.Compiler, core.Injector,\n router.ROUTES, router.ROUTER_CONFIGURATION, [router.UrlHandlingStrategy, new core.Optional()]\n ]\n },\n { provide: router.PreloadingStrategy, useExisting: router.NoPreloading }, router.provideRoutes([])\n ]\n },] }\n ];\n\n /**\n * @license\n * Copyright Google LLC 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 /**\n * @license\n * Copyright Google LLC 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 // This file only reexports content of the `src` folder. Keep it that way.\n\n /**\n * @license\n * Copyright Google LLC 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 /**\n * Generated bundle index. Do not edit.\n */\n\n exports.RouterTestingModule = RouterTestingModule;\n exports.SpyNgModuleFactoryLoader = SpyNgModuleFactoryLoader;\n exports.setupTestingRouter = setupTestingRouter;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=router-testing.umd.js.map\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/router/router-upgrade.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","router","upgrade","common","core","static","this","_static","anchor","ɵ0","locationSyncBootstrapListener","ngUpgrade","setUpLocationSync","urlType","$injector","Error","router$1","injector","get","Router","location","Location","$on","_","next","__","url","resolveUrl","hashIdx","indexOf","substring","path","normalize","pathname","navigateByUrl","search","hash","document","createElement","setAttribute","href","replace","RouterUpgradeInitializer","provide","APP_BOOTSTRAP_LISTENER","multi","useFactory","deps","UpgradeModule","Object","defineProperty","value"],"mappings":";;;;;CAMC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,mBAAoBA,QAAQ,iBAAkBA,QAAQ,mBAAoBA,QAAQ,4BACxJ,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,0BAA2B,CAAC,UAAW,kBAAmB,gBAAiB,kBAAmB,2BAA4BJ,GACpJA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,OAAST,EAAOQ,GAAGC,QAAU,GAAIT,EAAOQ,GAAGC,OAA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ACxChB,EAAQkB,kBAAoBA,EAC5BlB,EAAQe,GAAKA,EAEbwC,OAAOC,eAAexD,EAAS,aAAc,CAAEyD,OAAO","sourcesContent":["/**\n * @license Angular v10.0.
|
|
1
|
+
{"version":3,"sources":["packages/router/router-upgrade.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","router","upgrade","common","core","static","this","_static","anchor","ɵ0","locationSyncBootstrapListener","ngUpgrade","setUpLocationSync","urlType","$injector","Error","router$1","injector","get","Router","location","Location","$on","_","next","__","url","resolveUrl","hashIdx","indexOf","substring","path","normalize","pathname","navigateByUrl","search","hash","document","createElement","setAttribute","href","replace","RouterUpgradeInitializer","provide","APP_BOOTSTRAP_LISTENER","multi","useFactory","deps","UpgradeModule","Object","defineProperty","value"],"mappings":";;;;;CAMC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,mBAAoBA,QAAQ,iBAAkBA,QAAQ,mBAAoBA,QAAQ,4BACxJ,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,0BAA2B,CAAC,UAAW,kBAAmB,gBAAiB,kBAAmB,2BAA4BJ,GACpJA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,OAAST,EAAOQ,GAAGC,QAAU,GAAIT,EAAOQ,GAAGC,OAAOC,QAAU,IAAKV,EAAOQ,GAAGG,OAAQX,EAAOQ,GAAGI,KAAMZ,EAAOQ,GAAGC,OAAQT,EAAOQ,GAAGE,QAAQG,QAHrN,CAIEC,MAAM,SAAWZ,EAASS,EAAQC,EAAMH,EAAQM,GAAW;;;;;;;OASzD,IA6FIC,EA7FAC,EAAKC,EAiCT,SAASA,EAA8BC,GACnC,OAAO,WACHC,EAAkBD,IAe1B,SAASC,EAAkBD,EAAWE,GAElC,QADgB,IAAZA,IAAsBA,EAAU,SAC/BF,EAAUG,UACX,MAAM,IAAIC,MAAM,iNAEpB,IAAIC,EAAWL,EAAUM,SAASC,IAAIjB,EAAOkB,QACzCC,EAAWT,EAAUM,SAASC,IAAIf,EAAOkB,UAC7CV,EAAUG,UAAUI,IAAI,cACnBI,IAAI,wBAAwB,SAAUC,EAAGC,EAAMC,GAChD,IAAIC,EACJ,GAAgB,SAAZb,EACAa,EAAMC,EAAWH,OAEhB,CAAA,GAAgB,SAAZX,EAML,KAAM,gDAAkDA,EAJxD,IAAIe,EAAUJ,EAAKK,QAAQ,KAC3BH,EAAMC,EAAWH,EAAKM,UAAU,EAAGF,GAAWJ,EAAKM,UAAUF,EAAU,IAK3E,IAAIG,EAAOX,EAASY,UAAUN,EAAIO,UAClCjB,EAASkB,cAAcH,EAAOL,EAAIS,OAAST,EAAIU,SAsBvD,SAAST,EAAWD,GAMhB,OALKlB,IACDA,EAAS6B,SAASC,cAAc,MAEpC9B,EAAO+B,aAAa,OAAQb,GAC5BlB,EAAO+B,aAAa,OAAQ/B,EAAOgC,MAC5B,CAEHP,SAAU,IAAMzB,EAAOyB,SAASQ,QAAQ,MAAO,IAC/CN,OAAQ3B,EAAO2B,OACfC,KAAM5B,EAAO4B;;;;;;;;;;;;;;OAyBrB1C,EAAQgD,yBAzGuB,CAC3BC,QAASvC,EAAKwC,uBACdC,OAAO,EACPC,WAAYrC,EACZsC,KAAM,CAACxC,EAAQyC,gBAsGnBtD,EAAQgB,8BAAgCA,EACxChB,EAAQkB,kBAAoBA,EAC5BlB,EAAQe,GAAKA,EAEbwC,OAAOC,eAAexD,EAAS,aAAc,CAAEyD,OAAO","sourcesContent":["/**\n * @license Angular v10.0.5\n * (c) 2010-2020 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/router'), require('@angular/upgrade/static')) :\n typeof define === 'function' && define.amd ? define('@angular/router/upgrade', ['exports', '@angular/common', '@angular/core', '@angular/router', '@angular/upgrade/static'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.router = global.ng.router || {}, global.ng.router.upgrade = {}), global.ng.common, global.ng.core, global.ng.router, global.ng.upgrade.static));\n}(this, (function (exports, common, core, router, _static) { 'use strict';\n\n /**\n * @license\n * Copyright Google LLC 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 var ɵ0 = locationSyncBootstrapListener;\n /**\n * Creates an initializer that sets up `ngRoute` integration\n * along with setting up the Angular router.\n *\n * @usageNotes\n *\n * <code-example language=\"typescript\">\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 * </code-example>\n *\n * @publicApi\n */\n var RouterUpgradeInitializer = {\n provide: core.APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: ɵ0,\n deps: [_static.UpgradeModule]\n };\n /**\n * @internal\n */\n function locationSyncBootstrapListener(ngUpgrade) {\n return function () {\n setUpLocationSync(ngUpgrade);\n };\n }\n /**\n * Sets up a location change listener to trigger `history.pushState`.\n * Works around the problem that `onPopState` does not trigger `history.pushState`.\n * Must be called *after* calling `UpgradeModule.bootstrap`.\n *\n * @param ngUpgrade The upgrade NgModule.\n * @param urlType The location strategy.\n * @see `HashLocationStrategy`\n * @see `PathLocationStrategy`\n *\n * @publicApi\n */\n function setUpLocationSync(ngUpgrade, urlType) {\n if (urlType === void 0) { urlType = 'path'; }\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 router$1 = ngUpgrade.injector.get(router.Router);\n var location = ngUpgrade.injector.get(common.Location);\n ngUpgrade.$injector.get('$rootScope')\n .$on('$locationChangeStart', function (_, next, __) {\n var url;\n if (urlType === 'path') {\n url = resolveUrl(next);\n }\n else if (urlType === 'hash') {\n // Remove the first hash from the URL\n var hashIdx = next.indexOf('#');\n url = resolveUrl(next.substring(0, hashIdx) + next.substring(hashIdx + 1));\n }\n else {\n throw 'Invalid URLType passed to setUpLocationSync: ' + urlType;\n }\n var path = location.normalize(url.pathname);\n router$1.navigateByUrl(path + url.search + url.hash);\n });\n }\n /**\n * Normalizes and parses 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 */\n var anchor;\n function resolveUrl(url) {\n if (!anchor) {\n anchor = document.createElement('a');\n }\n anchor.setAttribute('href', url);\n anchor.setAttribute('href', anchor.href);\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 /**\n * @license\n * Copyright Google LLC 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 // This file only reexports content of the `src` folder. Keep it that way.\n\n /**\n * @license\n * Copyright Google LLC 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 /**\n * Generated bundle index. Do not edit.\n */\n\n exports.RouterUpgradeInitializer = RouterUpgradeInitializer;\n exports.locationSyncBootstrapListener = locationSyncBootstrapListener;\n exports.setUpLocationSync = setUpLocationSync;\n exports.ɵ0 = ɵ0;\n\n Object.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 v10.0.
|
|
2
|
+
* @license Angular v10.0.5
|
|
3
3
|
* (c) 2010-2020 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
* Base for events the router goes through, as opposed to events tied to a specific
|
|
323
323
|
* route. Fired one time for any given navigation.
|
|
324
324
|
*
|
|
325
|
-
*
|
|
325
|
+
* The following code shows how a class subscribes to router events.
|
|
326
326
|
*
|
|
327
327
|
* ```ts
|
|
328
328
|
* class MyService {
|
|
@@ -337,6 +337,7 @@
|
|
|
337
337
|
* ```
|
|
338
338
|
*
|
|
339
339
|
* @see `Event`
|
|
340
|
+
* @see [Router events summary](guide/router#router-events)
|
|
340
341
|
* @publicApi
|
|
341
342
|
*/
|
|
342
343
|
var RouterEvent = /** @class */ (function () {
|
|
@@ -382,6 +383,10 @@
|
|
|
382
383
|
/**
|
|
383
384
|
* An event triggered when a navigation ends successfully.
|
|
384
385
|
*
|
|
386
|
+
* @see `NavigationStart`
|
|
387
|
+
* @see `NavigationCancel`
|
|
388
|
+
* @see `NavigationError`
|
|
389
|
+
*
|
|
385
390
|
* @publicApi
|
|
386
391
|
*/
|
|
387
392
|
var NavigationEnd = /** @class */ (function (_super) {
|
|
@@ -405,10 +410,13 @@
|
|
|
405
410
|
}(RouterEvent));
|
|
406
411
|
/**
|
|
407
412
|
* An event triggered when a navigation is canceled, directly or indirectly.
|
|
408
|
-
*
|
|
409
|
-
* This can happen when a [route guard](guide/router-tutorial-toh#milestone-5-route-guards)
|
|
413
|
+
* This can happen when a route guard
|
|
410
414
|
* returns `false` or initiates a redirect by returning a `UrlTree`.
|
|
411
415
|
*
|
|
416
|
+
* @see `NavigationStart`
|
|
417
|
+
* @see `NavigationEnd`
|
|
418
|
+
* @see `NavigationError`
|
|
419
|
+
*
|
|
412
420
|
* @publicApi
|
|
413
421
|
*/
|
|
414
422
|
var NavigationCancel = /** @class */ (function (_super) {
|
|
@@ -433,6 +441,10 @@
|
|
|
433
441
|
/**
|
|
434
442
|
* An event triggered when a navigation fails due to an unexpected error.
|
|
435
443
|
*
|
|
444
|
+
* @see `NavigationStart`
|
|
445
|
+
* @see `NavigationEnd`
|
|
446
|
+
* @see `NavigationCancel`
|
|
447
|
+
*
|
|
436
448
|
* @publicApi
|
|
437
449
|
*/
|
|
438
450
|
var NavigationError = /** @class */ (function (_super) {
|
|
@@ -455,7 +467,7 @@
|
|
|
455
467
|
return NavigationError;
|
|
456
468
|
}(RouterEvent));
|
|
457
469
|
/**
|
|
458
|
-
*An event triggered when routes are recognized.
|
|
470
|
+
* An event triggered when routes are recognized.
|
|
459
471
|
*
|
|
460
472
|
* @publicApi
|
|
461
473
|
*/
|
|
@@ -484,6 +496,8 @@
|
|
|
484
496
|
/**
|
|
485
497
|
* An event triggered at the start of the Guard phase of routing.
|
|
486
498
|
*
|
|
499
|
+
* @see `GuardsCheckEnd`
|
|
500
|
+
*
|
|
487
501
|
* @publicApi
|
|
488
502
|
*/
|
|
489
503
|
var GuardsCheckStart = /** @class */ (function (_super) {
|
|
@@ -510,6 +524,8 @@
|
|
|
510
524
|
/**
|
|
511
525
|
* An event triggered at the end of the Guard phase of routing.
|
|
512
526
|
*
|
|
527
|
+
* @see `GuardsCheckStart`
|
|
528
|
+
*
|
|
513
529
|
* @publicApi
|
|
514
530
|
*/
|
|
515
531
|
var GuardsCheckEnd = /** @class */ (function (_super) {
|
|
@@ -542,6 +558,8 @@
|
|
|
542
558
|
* Runs in the "resolve" phase whether or not there is anything to resolve.
|
|
543
559
|
* In future, may change to only run when there are things to be resolved.
|
|
544
560
|
*
|
|
561
|
+
* @see `ResolveEnd`
|
|
562
|
+
*
|
|
545
563
|
* @publicApi
|
|
546
564
|
*/
|
|
547
565
|
var ResolveStart = /** @class */ (function (_super) {
|
|
@@ -595,6 +613,8 @@
|
|
|
595
613
|
/**
|
|
596
614
|
* An event triggered before lazy loading a route configuration.
|
|
597
615
|
*
|
|
616
|
+
* @see `RouteConfigLoadEnd`
|
|
617
|
+
*
|
|
598
618
|
* @publicApi
|
|
599
619
|
*/
|
|
600
620
|
var RouteConfigLoadStart = /** @class */ (function () {
|
|
@@ -611,6 +631,8 @@
|
|
|
611
631
|
/**
|
|
612
632
|
* An event triggered when a route has been lazy loaded.
|
|
613
633
|
*
|
|
634
|
+
* @see `RouteConfigLoadStart`
|
|
635
|
+
*
|
|
614
636
|
* @publicApi
|
|
615
637
|
*/
|
|
616
638
|
var RouteConfigLoadEnd = /** @class */ (function () {
|
|
@@ -648,7 +670,7 @@
|
|
|
648
670
|
* An event triggered at the end of the child-activation part
|
|
649
671
|
* of the Resolve phase of routing.
|
|
650
672
|
* @see `ChildActivationStart`
|
|
651
|
-
* @see `ResolveStart`
|
|
673
|
+
* @see `ResolveStart`
|
|
652
674
|
* @publicApi
|
|
653
675
|
*/
|
|
654
676
|
var ChildActivationEnd = /** @class */ (function () {
|
|
@@ -666,7 +688,7 @@
|
|
|
666
688
|
/**
|
|
667
689
|
* An event triggered at the start of the activation part
|
|
668
690
|
* of the Resolve phase of routing.
|
|
669
|
-
* @see ActivationEnd`
|
|
691
|
+
* @see `ActivationEnd`
|
|
670
692
|
* @see `ResolveStart`
|
|
671
693
|
*
|
|
672
694
|
* @publicApi
|
|
@@ -1754,7 +1776,8 @@
|
|
|
1754
1776
|
* and the resolved data.
|
|
1755
1777
|
* Use the `ActivatedRoute` properties to traverse the tree from any node.
|
|
1756
1778
|
*
|
|
1757
|
-
*
|
|
1779
|
+
* The following fragment shows how a component gets the root node
|
|
1780
|
+
* of the current state to establish its own route tree:
|
|
1758
1781
|
*
|
|
1759
1782
|
* ```
|
|
1760
1783
|
* @Component({templateUrl:'template.html'})
|
|
@@ -1770,6 +1793,7 @@
|
|
|
1770
1793
|
* ```
|
|
1771
1794
|
*
|
|
1772
1795
|
* @see `ActivatedRoute`
|
|
1796
|
+
* @see [Getting route information](guide/router#getting-route-information)
|
|
1773
1797
|
*
|
|
1774
1798
|
* @publicApi
|
|
1775
1799
|
*/
|
|
@@ -1813,9 +1837,14 @@
|
|
|
1813
1837
|
* that is loaded in an outlet.
|
|
1814
1838
|
* Use to traverse the `RouterState` tree and extract information from nodes.
|
|
1815
1839
|
*
|
|
1840
|
+
* The following example shows how to construct a component using information from a
|
|
1841
|
+
* currently activated route.
|
|
1842
|
+
*
|
|
1816
1843
|
* {@example router/activated-route/module.ts region="activated-route"
|
|
1817
1844
|
* header="activated-route.component.ts"}
|
|
1818
1845
|
*
|
|
1846
|
+
* @see [Getting route information](guide/router#getting-route-information)
|
|
1847
|
+
*
|
|
1819
1848
|
* @publicApi
|
|
1820
1849
|
*/
|
|
1821
1850
|
var ActivatedRoute = /** @class */ (function () {
|
|
@@ -1973,6 +2002,9 @@
|
|
|
1973
2002
|
* outlet at a particular moment in time. ActivatedRouteSnapshot can also be used to
|
|
1974
2003
|
* traverse the router state tree.
|
|
1975
2004
|
*
|
|
2005
|
+
* The following example initializes a component with route information extracted
|
|
2006
|
+
* from the snapshot of the root node at the time of creation.
|
|
2007
|
+
*
|
|
1976
2008
|
* ```
|
|
1977
2009
|
* @Component({templateUrl:'./my-component.html'})
|
|
1978
2010
|
* class MyComponent {
|
|
@@ -2090,8 +2122,8 @@
|
|
|
2090
2122
|
* This is a tree of activated route snapshots. Every node in this tree knows about
|
|
2091
2123
|
* the "consumed" URL segments, the extracted parameters, and the resolved data.
|
|
2092
2124
|
*
|
|
2093
|
-
*
|
|
2094
|
-
*
|
|
2125
|
+
* The following example shows how a component is initialized with information
|
|
2126
|
+
* from the snapshot of the root node's state at the time of creation.
|
|
2095
2127
|
*
|
|
2096
2128
|
* ```
|
|
2097
2129
|
* @Component({templateUrl:'template.html'})
|
|
@@ -4090,7 +4122,7 @@
|
|
|
4090
4122
|
/**
|
|
4091
4123
|
* @description
|
|
4092
4124
|
*
|
|
4093
|
-
* A service that provides navigation and URL manipulation capabilities.
|
|
4125
|
+
* A service that provides navigation among views and URL manipulation capabilities.
|
|
4094
4126
|
*
|
|
4095
4127
|
* @see `Route`.
|
|
4096
4128
|
* @see [Routing and Navigation Guide](guide/router).
|
|
@@ -4551,7 +4583,7 @@
|
|
|
4551
4583
|
this.events.next(event);
|
|
4552
4584
|
};
|
|
4553
4585
|
/**
|
|
4554
|
-
* Resets the configuration used for navigation and generating links.
|
|
4586
|
+
* Resets the route configuration used for navigation and generating links.
|
|
4555
4587
|
*
|
|
4556
4588
|
* @param config The route array for the new configuration.
|
|
4557
4589
|
*
|
|
@@ -4584,14 +4616,15 @@
|
|
|
4584
4616
|
}
|
|
4585
4617
|
};
|
|
4586
4618
|
/**
|
|
4587
|
-
*
|
|
4619
|
+
* Appends URL segments to the current URL tree to create a new URL tree.
|
|
4588
4620
|
*
|
|
4589
|
-
*
|
|
4590
|
-
*
|
|
4591
|
-
*
|
|
4592
|
-
*
|
|
4621
|
+
* @param commands An array of URL fragments with which to construct the new URL tree.
|
|
4622
|
+
* If the path is static, can be the literal URL string. For a dynamic path, pass an array of path
|
|
4623
|
+
* segments, followed by the parameters for each segment.
|
|
4624
|
+
* The fragments are applied to the current URL tree or the one provided in the `relativeTo`
|
|
4625
|
+
* property of the options object, if supplied.
|
|
4593
4626
|
* @param navigationExtras Options that control the navigation strategy. This function
|
|
4594
|
-
* only
|
|
4627
|
+
* only uses properties in `NavigationExtras` that would change the provided URL.
|
|
4595
4628
|
* @returns The new URL tree.
|
|
4596
4629
|
*
|
|
4597
4630
|
* @usageNotes
|
|
@@ -4658,9 +4691,10 @@
|
|
|
4658
4691
|
return createUrlTree(a, this.currentUrlTree, commands, q, f);
|
|
4659
4692
|
};
|
|
4660
4693
|
/**
|
|
4661
|
-
*
|
|
4694
|
+
* Navigates to a view using an absolute route path.
|
|
4662
4695
|
*
|
|
4663
|
-
* @param url An absolute
|
|
4696
|
+
* @param url An absolute path for a defined route. The function does not apply any delta to the
|
|
4697
|
+
* current URL.
|
|
4664
4698
|
* @param extras An object containing properties that modify the navigation strategy.
|
|
4665
4699
|
* The function ignores any properties in the `NavigationExtras` that would change the
|
|
4666
4700
|
* provided URL.
|
|
@@ -4670,6 +4704,8 @@
|
|
|
4670
4704
|
*
|
|
4671
4705
|
* @usageNotes
|
|
4672
4706
|
*
|
|
4707
|
+
* The following calls request navigation to an absolute path.
|
|
4708
|
+
*
|
|
4673
4709
|
* ```
|
|
4674
4710
|
* router.navigateByUrl("/team/33/user/11");
|
|
4675
4711
|
*
|
|
@@ -4677,6 +4713,8 @@
|
|
|
4677
4713
|
* router.navigateByUrl("/team/33/user/11", { skipLocationChange: true });
|
|
4678
4714
|
* ```
|
|
4679
4715
|
*
|
|
4716
|
+
* @see [Routing and Navigation guide](guide/router)
|
|
4717
|
+
*
|
|
4680
4718
|
*/
|
|
4681
4719
|
Router.prototype.navigateByUrl = function (url, extras) {
|
|
4682
4720
|
if (extras === void 0) { extras = { skipLocationChange: false }; }
|
|
@@ -4691,28 +4729,31 @@
|
|
|
4691
4729
|
* Navigate based on the provided array of commands and a starting point.
|
|
4692
4730
|
* If no starting route is provided, the navigation is absolute.
|
|
4693
4731
|
*
|
|
4694
|
-
*
|
|
4695
|
-
*
|
|
4696
|
-
*
|
|
4697
|
-
*
|
|
4732
|
+
* @param commands An array of URL fragments with which to construct the target URL.
|
|
4733
|
+
* If the path is static, can be the literal URL string. For a dynamic path, pass an array of path
|
|
4734
|
+
* segments, followed by the parameters for each segment.
|
|
4735
|
+
* The fragments are applied to the current URL or the one provided in the `relativeTo` property
|
|
4736
|
+
* of the options object, if supplied.
|
|
4737
|
+
* @param extras An options object that determines how the URL should be constructed or
|
|
4738
|
+
* interpreted.
|
|
4739
|
+
*
|
|
4740
|
+
* @returns A Promise that resolves to `true` when navigation succeeds, to `false` when navigation
|
|
4741
|
+
* fails,
|
|
4742
|
+
* or is rejected on error.
|
|
4698
4743
|
*
|
|
4699
4744
|
* @usageNotes
|
|
4700
4745
|
*
|
|
4746
|
+
* The following calls request navigation to a dynamic route path relative to the current URL.
|
|
4747
|
+
*
|
|
4701
4748
|
* ```
|
|
4702
4749
|
* router.navigate(['team', 33, 'user', 11], {relativeTo: route});
|
|
4703
4750
|
*
|
|
4704
|
-
* // Navigate without updating the URL
|
|
4751
|
+
* // Navigate without updating the URL, overriding the default behavior
|
|
4705
4752
|
* router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});
|
|
4706
4753
|
* ```
|
|
4707
4754
|
*
|
|
4708
|
-
*
|
|
4709
|
-
* or the one provided in the `relativeTo` property of the second parameter (the
|
|
4710
|
-
* `NavigationExtras`).
|
|
4755
|
+
* @see [Routing and Navigation guide](guide/router)
|
|
4711
4756
|
*
|
|
4712
|
-
* In order to affect this browser's `history.state` entry, the `state`
|
|
4713
|
-
* parameter can be passed. This must be an object because the router
|
|
4714
|
-
* will add the `navigationId` property to this object before creating
|
|
4715
|
-
* the new history item.
|
|
4716
4757
|
*/
|
|
4717
4758
|
Router.prototype.navigate = function (commands, extras) {
|
|
4718
4759
|
if (extras === void 0) { extras = { skipLocationChange: false }; }
|
|
@@ -5793,53 +5834,23 @@
|
|
|
5793
5834
|
return new core.NgProbeToken('Router', Router);
|
|
5794
5835
|
}
|
|
5795
5836
|
/**
|
|
5796
|
-
* @usageNotes
|
|
5797
|
-
*
|
|
5798
|
-
* RouterModule can be imported multiple times: once per lazily-loaded bundle.
|
|
5799
|
-
* Since the router deals with a global shared resource--location, we cannot have
|
|
5800
|
-
* more than one router service active.
|
|
5801
|
-
*
|
|
5802
|
-
* That is why there are two ways to create the module: `RouterModule.forRoot` and
|
|
5803
|
-
* `RouterModule.forChild`.
|
|
5804
|
-
*
|
|
5805
|
-
* * `forRoot` creates a module that contains all the directives, the given routes, and the router
|
|
5806
|
-
* service itself.
|
|
5807
|
-
* * `forChild` creates a module that contains all the directives and the given routes, but does not
|
|
5808
|
-
* include the router service.
|
|
5809
|
-
*
|
|
5810
|
-
* When registered at the root, the module should be used as follows
|
|
5811
|
-
*
|
|
5812
|
-
* ```
|
|
5813
|
-
* @NgModule({
|
|
5814
|
-
* imports: [RouterModule.forRoot(ROUTES)]
|
|
5815
|
-
* })
|
|
5816
|
-
* class MyNgModule {}
|
|
5817
|
-
* ```
|
|
5818
|
-
*
|
|
5819
|
-
* For submodules and lazy loaded submodules the module should be used as follows:
|
|
5820
|
-
*
|
|
5821
|
-
* ```
|
|
5822
|
-
* @NgModule({
|
|
5823
|
-
* imports: [RouterModule.forChild(ROUTES)]
|
|
5824
|
-
* })
|
|
5825
|
-
* class MyNgModule {}
|
|
5826
|
-
* ```
|
|
5827
|
-
*
|
|
5828
5837
|
* @description
|
|
5829
5838
|
*
|
|
5830
|
-
* Adds
|
|
5839
|
+
* Adds directives and providers for in-app navigation among views defined in an application.
|
|
5840
|
+
* Use the Angular `Router` service to declaratively specify application states and manage state
|
|
5841
|
+
* transitions.
|
|
5831
5842
|
*
|
|
5832
|
-
*
|
|
5833
|
-
*
|
|
5834
|
-
*
|
|
5835
|
-
* Doing this transparently is not trivial.
|
|
5843
|
+
* You can import this NgModule multiple times, once for each lazy-loaded bundle.
|
|
5844
|
+
* However, only one `Router` service can be active.
|
|
5845
|
+
* To ensure this, there are two ways to register routes when importing this module:
|
|
5836
5846
|
*
|
|
5837
|
-
* The
|
|
5838
|
-
*
|
|
5839
|
-
*
|
|
5847
|
+
* * The `forRoot()` method creates an `NgModule` that contains all the directives, the given
|
|
5848
|
+
* routes, and the `Router` service itself.
|
|
5849
|
+
* * The `forChild()` method creates an `NgModule` that contains all the directives and the given
|
|
5850
|
+
* routes, but does not include the `Router` service.
|
|
5840
5851
|
*
|
|
5841
|
-
* @see [Routing and Navigation](guide/router
|
|
5842
|
-
* overview of how the
|
|
5852
|
+
* @see [Routing and Navigation guide](guide/router) for an
|
|
5853
|
+
* overview of how the `Router` service should be used.
|
|
5843
5854
|
*
|
|
5844
5855
|
* @publicApi
|
|
5845
5856
|
*/
|
|
@@ -5851,9 +5862,19 @@
|
|
|
5851
5862
|
* Creates and configures a module with all the router providers and directives.
|
|
5852
5863
|
* Optionally sets up an application listener to perform an initial navigation.
|
|
5853
5864
|
*
|
|
5865
|
+
* When registering the NgModule at the root, import as follows:
|
|
5866
|
+
*
|
|
5867
|
+
* ```
|
|
5868
|
+
* @NgModule({
|
|
5869
|
+
* imports: [RouterModule.forRoot(ROUTES)]
|
|
5870
|
+
* })
|
|
5871
|
+
* class MyNgModule {}
|
|
5872
|
+
* ```
|
|
5873
|
+
*
|
|
5854
5874
|
* @param routes An array of `Route` objects that define the navigation paths for the application.
|
|
5855
5875
|
* @param config An `ExtraOptions` configuration object that controls how navigation is performed.
|
|
5856
|
-
* @return The new
|
|
5876
|
+
* @return The new `NgModule`.
|
|
5877
|
+
*
|
|
5857
5878
|
*/
|
|
5858
5879
|
RouterModule.forRoot = function (routes, config) {
|
|
5859
5880
|
return {
|
|
@@ -5888,7 +5909,20 @@
|
|
|
5888
5909
|
};
|
|
5889
5910
|
};
|
|
5890
5911
|
/**
|
|
5891
|
-
* Creates a module with all the router directives and a provider registering routes
|
|
5912
|
+
* Creates a module with all the router directives and a provider registering routes,
|
|
5913
|
+
* without creating a new Router service.
|
|
5914
|
+
* When registering for submodules and lazy-loaded submodules, create the NgModule as follows:
|
|
5915
|
+
*
|
|
5916
|
+
* ```
|
|
5917
|
+
* @NgModule({
|
|
5918
|
+
* imports: [RouterModule.forChild(ROUTES)]
|
|
5919
|
+
* })
|
|
5920
|
+
* class MyNgModule {}
|
|
5921
|
+
* ```
|
|
5922
|
+
*
|
|
5923
|
+
* @param routes An array of `Route` objects that define the navigation paths for the submodule.
|
|
5924
|
+
* @return The new NgModule.
|
|
5925
|
+
*
|
|
5892
5926
|
*/
|
|
5893
5927
|
RouterModule.forChild = function (routes) {
|
|
5894
5928
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
@@ -6112,7 +6146,7 @@
|
|
|
6112
6146
|
/**
|
|
6113
6147
|
* @publicApi
|
|
6114
6148
|
*/
|
|
6115
|
-
var VERSION = new core.Version('10.0.
|
|
6149
|
+
var VERSION = new core.Version('10.0.5');
|
|
6116
6150
|
|
|
6117
6151
|
/**
|
|
6118
6152
|
* @license
|