@angular/router 12.0.0 → 12.0.4
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-upgrade.umd.js +1 -1
- package/bundles/router.umd.js +28 -8
- package/bundles/router.umd.js.map +1 -1
- package/esm2015/src/apply_redirects.js +3 -2
- package/esm2015/src/config.js +1 -1
- package/esm2015/src/events.js +3 -3
- package/esm2015/src/router.js +9 -1
- package/esm2015/src/router_config_loader.js +7 -2
- package/esm2015/src/router_state.js +5 -1
- package/esm2015/src/url_tree.js +5 -3
- package/esm2015/src/version.js +1 -1
- package/fesm2015/router.js +28 -8
- package/fesm2015/router.js.map +1 -1
- package/fesm2015/testing.js +1 -1
- package/fesm2015/upgrade.js +1 -1
- package/package.json +5 -8
- package/router.d.ts +33 -9
- 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
package/bundles/router.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v12.0.
|
|
2
|
+
* @license Angular v12.0.4
|
|
3
3
|
* (c) 2010-2021 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -348,7 +348,7 @@
|
|
|
348
348
|
* ```
|
|
349
349
|
*
|
|
350
350
|
* @see `Event`
|
|
351
|
-
* @see [Router events summary](guide/router#router-events)
|
|
351
|
+
* @see [Router events summary](guide/router-reference#router-events)
|
|
352
352
|
* @publicApi
|
|
353
353
|
*/
|
|
354
354
|
var RouterEvent = /** @class */ (function () {
|
|
@@ -421,7 +421,7 @@
|
|
|
421
421
|
}(RouterEvent));
|
|
422
422
|
/**
|
|
423
423
|
* An event triggered when a navigation is canceled, directly or indirectly.
|
|
424
|
-
* This can happen when a route guard
|
|
424
|
+
* This can happen for several reasons including when a route guard
|
|
425
425
|
* returns `false` or initiates a redirect by returning a `UrlTree`.
|
|
426
426
|
*
|
|
427
427
|
* @see `NavigationStart`
|
|
@@ -1339,12 +1339,14 @@
|
|
|
1339
1339
|
.join('');
|
|
1340
1340
|
}
|
|
1341
1341
|
function serializeQueryParams(params) {
|
|
1342
|
-
var strParams = Object.keys(params)
|
|
1342
|
+
var strParams = Object.keys(params)
|
|
1343
|
+
.map(function (name) {
|
|
1343
1344
|
var value = params[name];
|
|
1344
1345
|
return Array.isArray(value) ?
|
|
1345
1346
|
value.map(function (v) { return encodeUriQuery(name) + "=" + encodeUriQuery(v); }).join('&') :
|
|
1346
1347
|
encodeUriQuery(name) + "=" + encodeUriQuery(value);
|
|
1347
|
-
})
|
|
1348
|
+
})
|
|
1349
|
+
.filter(function (s) { return !!s; });
|
|
1348
1350
|
return strParams.length ? "?" + strParams.join('&') : '';
|
|
1349
1351
|
}
|
|
1350
1352
|
var SEGMENT_RE = /^[^\/()?;=#]+/;
|
|
@@ -1723,6 +1725,10 @@
|
|
|
1723
1725
|
* The following example shows how to construct a component using information from a
|
|
1724
1726
|
* currently activated route.
|
|
1725
1727
|
*
|
|
1728
|
+
* Note: the observables in this class only emit when the current and previous values differ based
|
|
1729
|
+
* on shallow equality. For example, changing deeply nested properties in resolved `data` will not
|
|
1730
|
+
* cause the `ActivatedRoute.data` `Observable` to emit a new value.
|
|
1731
|
+
*
|
|
1726
1732
|
* {@example router/activated-route/module.ts region="activated-route"
|
|
1727
1733
|
* header="activated-route.component.ts"}
|
|
1728
1734
|
*
|
|
@@ -3083,7 +3089,8 @@
|
|
|
3083
3089
|
}));
|
|
3084
3090
|
return urlTrees$.pipe(operators.catchError(function (e) {
|
|
3085
3091
|
if (e instanceof AbsoluteRedirect) {
|
|
3086
|
-
//
|
|
3092
|
+
// After an absolute redirect we do not apply any more redirects!
|
|
3093
|
+
// If this implementation changes, update the documentation note in `redirectTo`.
|
|
3087
3094
|
_this.allowRedirects = false;
|
|
3088
3095
|
// we need to run matching, so we can fetch all lazy-loaded modules
|
|
3089
3096
|
return _this.match(e.urlTree);
|
|
@@ -4208,7 +4215,12 @@
|
|
|
4208
4215
|
*/
|
|
4209
4216
|
/**
|
|
4210
4217
|
* The [DI token](guide/glossary/#di-token) for a router configuration.
|
|
4211
|
-
*
|
|
4218
|
+
*
|
|
4219
|
+
* `ROUTES` is a low level API for router configuration via dependency injection.
|
|
4220
|
+
*
|
|
4221
|
+
* We recommend that in almost all cases to use higher level APIs such as `RouterModule.forRoot()`,
|
|
4222
|
+
* `RouterModule.forChild()`, `provideRoutes`, or `Router.resetConfig()`.
|
|
4223
|
+
*
|
|
4212
4224
|
* @publicApi
|
|
4213
4225
|
*/
|
|
4214
4226
|
var ROUTES = new core.InjectionToken('ROUTES');
|
|
@@ -4492,8 +4504,16 @@
|
|
|
4492
4504
|
this.routeReuseStrategy = new DefaultRouteReuseStrategy();
|
|
4493
4505
|
/**
|
|
4494
4506
|
* How to handle a navigation request to the current URL. One of:
|
|
4507
|
+
*
|
|
4495
4508
|
* - `'ignore'` : The router ignores the request.
|
|
4496
4509
|
* - `'reload'` : The router reloads the URL. Use to implement a "refresh" feature.
|
|
4510
|
+
*
|
|
4511
|
+
* Note that this only configures whether the Route reprocesses the URL and triggers related
|
|
4512
|
+
* action and events like redirects, guards, and resolvers. By default, the router re-uses a
|
|
4513
|
+
* component instance when it re-navigates to the same component type without visiting a different
|
|
4514
|
+
* component first. This behavior is configured by the `RouteReuseStrategy`. In order to reload
|
|
4515
|
+
* routed components on same url navigation, you need to set `onSameUrlNavigation` to `'reload'`
|
|
4516
|
+
* _and_ provide a `RouteReuseStrategy` which returns `false` for `shouldReuseRoute`.
|
|
4497
4517
|
*/
|
|
4498
4518
|
this.onSameUrlNavigation = 'ignore';
|
|
4499
4519
|
/**
|
|
@@ -6545,7 +6565,7 @@
|
|
|
6545
6565
|
/**
|
|
6546
6566
|
* @publicApi
|
|
6547
6567
|
*/
|
|
6548
|
-
var VERSION = new core.Version('12.0.
|
|
6568
|
+
var VERSION = new core.Version('12.0.4');
|
|
6549
6569
|
|
|
6550
6570
|
/**
|
|
6551
6571
|
* @license
|