@angular/router 5.2.2 → 5.2.6
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 +96 -63
- package/bundles/router.umd.js.map +1 -1
- package/bundles/router.umd.min.js +3 -3
- package/bundles/router.umd.min.js.map +1 -1
- package/esm2015/router.js +78 -61
- package/esm2015/router.js.map +1 -1
- package/esm2015/testing.js +1 -1
- package/esm2015/upgrade.js +1 -1
- package/esm5/router.js +95 -62
- 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/router.d.ts +5 -0
- package/src/router_state.d.ts +1 -0
- package/testing.d.ts +1 -1
- package/upgrade.d.ts +1 -1
package/esm2015/router.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v5.2.
|
|
2
|
+
* @license Angular v5.2.6
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -4173,14 +4173,15 @@ class Router {
|
|
|
4173
4173
|
* @return {?}
|
|
4174
4174
|
*/
|
|
4175
4175
|
setUpLocationChangeListener() {
|
|
4176
|
-
// Zone.
|
|
4177
|
-
//
|
|
4176
|
+
// Don't need to use Zone.wrap any more, because zone.js
|
|
4177
|
+
// already patch onPopState, so location change callback will
|
|
4178
|
+
// run into ngZone
|
|
4178
4179
|
if (!this.locationSubscription) {
|
|
4179
|
-
this.locationSubscription = /** @type {?} */ (this.location.subscribe(
|
|
4180
|
+
this.locationSubscription = /** @type {?} */ (this.location.subscribe((change) => {
|
|
4180
4181
|
const /** @type {?} */ rawUrlTree = this.urlSerializer.parse(change['url']);
|
|
4181
4182
|
const /** @type {?} */ source = change['type'] === 'popstate' ? 'popstate' : 'hashchange';
|
|
4182
4183
|
setTimeout(() => { this.scheduleNavigation(rawUrlTree, source, { replaceUrl: true }); }, 0);
|
|
4183
|
-
}))
|
|
4184
|
+
}));
|
|
4184
4185
|
}
|
|
4185
4186
|
}
|
|
4186
4187
|
/**
|
|
@@ -4564,66 +4565,82 @@ class Router {
|
|
|
4564
4565
|
return { appliedUrl, state: null, shouldActivate };
|
|
4565
4566
|
}
|
|
4566
4567
|
});
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
navigationIsSuccessful =
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4568
|
+
this.activateRoutes(routerState$, this.routerState, this.currentUrlTree, id, url, rawUrl, skipLocationChange, replaceUrl, resolvePromise, rejectPromise);
|
|
4569
|
+
});
|
|
4570
|
+
}
|
|
4571
|
+
/**
|
|
4572
|
+
* Performs the logic of activating routes. This is a synchronous process by default. While this
|
|
4573
|
+
* is a private method, it could be overridden to make activation asynchronous.
|
|
4574
|
+
* @param {?} state
|
|
4575
|
+
* @param {?} storedState
|
|
4576
|
+
* @param {?} storedUrl
|
|
4577
|
+
* @param {?} id
|
|
4578
|
+
* @param {?} url
|
|
4579
|
+
* @param {?} rawUrl
|
|
4580
|
+
* @param {?} skipLocationChange
|
|
4581
|
+
* @param {?} replaceUrl
|
|
4582
|
+
* @param {?} resolvePromise
|
|
4583
|
+
* @param {?} rejectPromise
|
|
4584
|
+
* @return {?}
|
|
4585
|
+
*/
|
|
4586
|
+
activateRoutes(state, storedState, storedUrl, id, url, rawUrl, skipLocationChange, replaceUrl, resolvePromise, rejectPromise) {
|
|
4587
|
+
// applied the new router state
|
|
4588
|
+
// this operation has side effects
|
|
4589
|
+
let /** @type {?} */ navigationIsSuccessful;
|
|
4590
|
+
state
|
|
4591
|
+
.forEach(({ appliedUrl, state, shouldActivate }) => {
|
|
4592
|
+
if (!shouldActivate || id !== this.navigationId) {
|
|
4593
|
+
navigationIsSuccessful = false;
|
|
4594
|
+
return;
|
|
4595
|
+
}
|
|
4596
|
+
this.currentUrlTree = appliedUrl;
|
|
4597
|
+
this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, rawUrl);
|
|
4598
|
+
(/** @type {?} */ (this)).routerState = state;
|
|
4599
|
+
if (!skipLocationChange) {
|
|
4600
|
+
const /** @type {?} */ path = this.urlSerializer.serialize(this.rawUrlTree);
|
|
4601
|
+
if (this.location.isCurrentPathEqualTo(path) || replaceUrl) {
|
|
4602
|
+
this.location.replaceState(path);
|
|
4600
4603
|
}
|
|
4601
4604
|
else {
|
|
4602
|
-
this.
|
|
4603
|
-
(/** @type {?} */ (this.events))
|
|
4604
|
-
.next(new NavigationCancel(id, this.serializeUrl(url), ''));
|
|
4605
|
-
resolvePromise(false);
|
|
4605
|
+
this.location.go(path);
|
|
4606
4606
|
}
|
|
4607
|
-
}
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4607
|
+
}
|
|
4608
|
+
new ActivateRoutes(this.routeReuseStrategy, state, storedState, (evt) => this.triggerEvent(evt))
|
|
4609
|
+
.activate(this.rootContexts);
|
|
4610
|
+
navigationIsSuccessful = true;
|
|
4611
|
+
})
|
|
4612
|
+
.then(() => {
|
|
4613
|
+
if (navigationIsSuccessful) {
|
|
4614
|
+
this.navigated = true;
|
|
4615
|
+
(/** @type {?} */ (this.events))
|
|
4616
|
+
.next(new NavigationEnd(id, this.serializeUrl(url), this.serializeUrl(this.currentUrlTree)));
|
|
4617
|
+
resolvePromise(true);
|
|
4618
|
+
}
|
|
4619
|
+
else {
|
|
4620
|
+
this.resetUrlToCurrentUrlTree();
|
|
4621
|
+
(/** @type {?} */ (this.events))
|
|
4622
|
+
.next(new NavigationCancel(id, this.serializeUrl(url), ''));
|
|
4623
|
+
resolvePromise(false);
|
|
4624
|
+
}
|
|
4625
|
+
}, (e) => {
|
|
4626
|
+
if (isNavigationCancelingError(e)) {
|
|
4627
|
+
this.navigated = true;
|
|
4628
|
+
this.resetStateAndUrl(storedState, storedUrl, rawUrl);
|
|
4629
|
+
(/** @type {?} */ (this.events))
|
|
4630
|
+
.next(new NavigationCancel(id, this.serializeUrl(url), e.message));
|
|
4631
|
+
resolvePromise(false);
|
|
4632
|
+
}
|
|
4633
|
+
else {
|
|
4634
|
+
this.resetStateAndUrl(storedState, storedUrl, rawUrl);
|
|
4635
|
+
(/** @type {?} */ (this.events))
|
|
4636
|
+
.next(new NavigationError(id, this.serializeUrl(url), e));
|
|
4637
|
+
try {
|
|
4638
|
+
resolvePromise(this.errorHandler(e));
|
|
4614
4639
|
}
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
(/** @type {?} */ (this.events))
|
|
4618
|
-
.next(new NavigationError(id, this.serializeUrl(url), e));
|
|
4619
|
-
try {
|
|
4620
|
-
resolvePromise(this.errorHandler(e));
|
|
4621
|
-
}
|
|
4622
|
-
catch (/** @type {?} */ ee) {
|
|
4623
|
-
rejectPromise(ee);
|
|
4624
|
-
}
|
|
4640
|
+
catch (/** @type {?} */ ee) {
|
|
4641
|
+
rejectPromise(ee);
|
|
4625
4642
|
}
|
|
4626
|
-
}
|
|
4643
|
+
}
|
|
4627
4644
|
});
|
|
4628
4645
|
}
|
|
4629
4646
|
/**
|
|
@@ -6232,7 +6249,7 @@ function provideRouterInitializer() {
|
|
|
6232
6249
|
/**
|
|
6233
6250
|
* \@stable
|
|
6234
6251
|
*/
|
|
6235
|
-
const VERSION = new Version('5.2.
|
|
6252
|
+
const VERSION = new Version('5.2.6');
|
|
6236
6253
|
|
|
6237
6254
|
/**
|
|
6238
6255
|
* @fileoverview added by tsickle
|