@angular/router 5.2.4 → 5.2.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 +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 +91 -59
- 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 +73 -57
- package/esm2015/router.js.map +1 -1
- package/esm2015/testing.js +1 -1
- package/esm2015/upgrade.js +1 -1
- package/esm5/router.js +90 -58
- 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/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.5
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -4565,66 +4565,82 @@ class Router {
|
|
|
4565
4565
|
return { appliedUrl, state: null, shouldActivate };
|
|
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
|
-
|
|
4593
|
-
navigationIsSuccessful =
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
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);
|
|
4601
4603
|
}
|
|
4602
4604
|
else {
|
|
4603
|
-
this.
|
|
4604
|
-
(/** @type {?} */ (this.events))
|
|
4605
|
-
.next(new NavigationCancel(id, this.serializeUrl(url), ''));
|
|
4606
|
-
resolvePromise(false);
|
|
4605
|
+
this.location.go(path);
|
|
4607
4606
|
}
|
|
4608
|
-
}
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
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));
|
|
4615
4639
|
}
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
(/** @type {?} */ (this.events))
|
|
4619
|
-
.next(new NavigationError(id, this.serializeUrl(url), e));
|
|
4620
|
-
try {
|
|
4621
|
-
resolvePromise(this.errorHandler(e));
|
|
4622
|
-
}
|
|
4623
|
-
catch (/** @type {?} */ ee) {
|
|
4624
|
-
rejectPromise(ee);
|
|
4625
|
-
}
|
|
4640
|
+
catch (/** @type {?} */ ee) {
|
|
4641
|
+
rejectPromise(ee);
|
|
4626
4642
|
}
|
|
4627
|
-
}
|
|
4643
|
+
}
|
|
4628
4644
|
});
|
|
4629
4645
|
}
|
|
4630
4646
|
/**
|
|
@@ -6233,7 +6249,7 @@ function provideRouterInitializer() {
|
|
|
6233
6249
|
/**
|
|
6234
6250
|
* \@stable
|
|
6235
6251
|
*/
|
|
6236
|
-
const VERSION = new Version('5.2.
|
|
6252
|
+
const VERSION = new Version('5.2.5');
|
|
6237
6253
|
|
|
6238
6254
|
/**
|
|
6239
6255
|
* @fileoverview added by tsickle
|