@angular/router 5.2.1 → 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 +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/pre_activation.d.ts +2 -2
- 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/testing.js
CHANGED
package/esm2015/upgrade.js
CHANGED
package/esm5/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
|
*/
|
|
@@ -4775,14 +4775,15 @@ var Router = /** @class */ (function () {
|
|
|
4775
4775
|
*/
|
|
4776
4776
|
function () {
|
|
4777
4777
|
var _this = this;
|
|
4778
|
-
// Zone.
|
|
4779
|
-
//
|
|
4778
|
+
// Don't need to use Zone.wrap any more, because zone.js
|
|
4779
|
+
// already patch onPopState, so location change callback will
|
|
4780
|
+
// run into ngZone
|
|
4780
4781
|
if (!this.locationSubscription) {
|
|
4781
|
-
this.locationSubscription = /** @type {?} */ (this.location.subscribe(
|
|
4782
|
+
this.locationSubscription = /** @type {?} */ (this.location.subscribe(function (change) {
|
|
4782
4783
|
var /** @type {?} */ rawUrlTree = _this.urlSerializer.parse(change['url']);
|
|
4783
4784
|
var /** @type {?} */ source = change['type'] === 'popstate' ? 'popstate' : 'hashchange';
|
|
4784
4785
|
setTimeout(function () { _this.scheduleNavigation(rawUrlTree, source, { replaceUrl: true }); }, 0);
|
|
4785
|
-
}))
|
|
4786
|
+
}));
|
|
4786
4787
|
}
|
|
4787
4788
|
};
|
|
4788
4789
|
Object.defineProperty(Router.prototype, "url", {
|
|
@@ -5449,67 +5450,99 @@ var Router = /** @class */ (function () {
|
|
|
5449
5450
|
return { appliedUrl: appliedUrl, state: null, shouldActivate: shouldActivate };
|
|
5450
5451
|
}
|
|
5451
5452
|
});
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5453
|
+
_this.activateRoutes(routerState$, _this.routerState, _this.currentUrlTree, id, url, rawUrl, skipLocationChange, replaceUrl, resolvePromise, rejectPromise);
|
|
5454
|
+
});
|
|
5455
|
+
};
|
|
5456
|
+
/**
|
|
5457
|
+
* Performs the logic of activating routes. This is a synchronous process by default. While this
|
|
5458
|
+
* is a private method, it could be overridden to make activation asynchronous.
|
|
5459
|
+
* @param {?} state
|
|
5460
|
+
* @param {?} storedState
|
|
5461
|
+
* @param {?} storedUrl
|
|
5462
|
+
* @param {?} id
|
|
5463
|
+
* @param {?} url
|
|
5464
|
+
* @param {?} rawUrl
|
|
5465
|
+
* @param {?} skipLocationChange
|
|
5466
|
+
* @param {?} replaceUrl
|
|
5467
|
+
* @param {?} resolvePromise
|
|
5468
|
+
* @param {?} rejectPromise
|
|
5469
|
+
* @return {?}
|
|
5470
|
+
*/
|
|
5471
|
+
Router.prototype.activateRoutes = /**
|
|
5472
|
+
* Performs the logic of activating routes. This is a synchronous process by default. While this
|
|
5473
|
+
* is a private method, it could be overridden to make activation asynchronous.
|
|
5474
|
+
* @param {?} state
|
|
5475
|
+
* @param {?} storedState
|
|
5476
|
+
* @param {?} storedUrl
|
|
5477
|
+
* @param {?} id
|
|
5478
|
+
* @param {?} url
|
|
5479
|
+
* @param {?} rawUrl
|
|
5480
|
+
* @param {?} skipLocationChange
|
|
5481
|
+
* @param {?} replaceUrl
|
|
5482
|
+
* @param {?} resolvePromise
|
|
5483
|
+
* @param {?} rejectPromise
|
|
5484
|
+
* @return {?}
|
|
5485
|
+
*/
|
|
5486
|
+
function (state, storedState, storedUrl, id, url, rawUrl, skipLocationChange, replaceUrl, resolvePromise, rejectPromise) {
|
|
5487
|
+
var _this = this;
|
|
5488
|
+
// applied the new router state
|
|
5489
|
+
// this operation has side effects
|
|
5490
|
+
var /** @type {?} */ navigationIsSuccessful;
|
|
5491
|
+
state
|
|
5492
|
+
.forEach(function (_a) {
|
|
5493
|
+
var appliedUrl = _a.appliedUrl, state = _a.state, shouldActivate = _a.shouldActivate;
|
|
5494
|
+
if (!shouldActivate || id !== _this.navigationId) {
|
|
5495
|
+
navigationIsSuccessful = false;
|
|
5496
|
+
return;
|
|
5497
|
+
}
|
|
5498
|
+
_this.currentUrlTree = appliedUrl;
|
|
5499
|
+
_this.rawUrlTree = _this.urlHandlingStrategy.merge(_this.currentUrlTree, rawUrl);
|
|
5500
|
+
(/** @type {?} */ (_this)).routerState = state;
|
|
5501
|
+
if (!skipLocationChange) {
|
|
5502
|
+
var /** @type {?} */ path = _this.urlSerializer.serialize(_this.rawUrlTree);
|
|
5503
|
+
if (_this.location.isCurrentPathEqualTo(path) || replaceUrl) {
|
|
5504
|
+
_this.location.replaceState(path);
|
|
5486
5505
|
}
|
|
5487
5506
|
else {
|
|
5488
|
-
_this.
|
|
5489
|
-
(/** @type {?} */ (_this.events))
|
|
5490
|
-
.next(new NavigationCancel(id, _this.serializeUrl(url), ''));
|
|
5491
|
-
resolvePromise(false);
|
|
5507
|
+
_this.location.go(path);
|
|
5492
5508
|
}
|
|
5493
|
-
}
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5509
|
+
}
|
|
5510
|
+
new ActivateRoutes(_this.routeReuseStrategy, state, storedState, function (evt) { return _this.triggerEvent(evt); })
|
|
5511
|
+
.activate(_this.rootContexts);
|
|
5512
|
+
navigationIsSuccessful = true;
|
|
5513
|
+
})
|
|
5514
|
+
.then(function () {
|
|
5515
|
+
if (navigationIsSuccessful) {
|
|
5516
|
+
_this.navigated = true;
|
|
5517
|
+
(/** @type {?} */ (_this.events))
|
|
5518
|
+
.next(new NavigationEnd(id, _this.serializeUrl(url), _this.serializeUrl(_this.currentUrlTree)));
|
|
5519
|
+
resolvePromise(true);
|
|
5520
|
+
}
|
|
5521
|
+
else {
|
|
5522
|
+
_this.resetUrlToCurrentUrlTree();
|
|
5523
|
+
(/** @type {?} */ (_this.events))
|
|
5524
|
+
.next(new NavigationCancel(id, _this.serializeUrl(url), ''));
|
|
5525
|
+
resolvePromise(false);
|
|
5526
|
+
}
|
|
5527
|
+
}, function (e) {
|
|
5528
|
+
if (isNavigationCancelingError(e)) {
|
|
5529
|
+
_this.navigated = true;
|
|
5530
|
+
_this.resetStateAndUrl(storedState, storedUrl, rawUrl);
|
|
5531
|
+
(/** @type {?} */ (_this.events))
|
|
5532
|
+
.next(new NavigationCancel(id, _this.serializeUrl(url), e.message));
|
|
5533
|
+
resolvePromise(false);
|
|
5534
|
+
}
|
|
5535
|
+
else {
|
|
5536
|
+
_this.resetStateAndUrl(storedState, storedUrl, rawUrl);
|
|
5537
|
+
(/** @type {?} */ (_this.events))
|
|
5538
|
+
.next(new NavigationError(id, _this.serializeUrl(url), e));
|
|
5539
|
+
try {
|
|
5540
|
+
resolvePromise(_this.errorHandler(e));
|
|
5500
5541
|
}
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
(/** @type {?} */ (_this.events))
|
|
5504
|
-
.next(new NavigationError(id, _this.serializeUrl(url), e));
|
|
5505
|
-
try {
|
|
5506
|
-
resolvePromise(_this.errorHandler(e));
|
|
5507
|
-
}
|
|
5508
|
-
catch (/** @type {?} */ ee) {
|
|
5509
|
-
rejectPromise(ee);
|
|
5510
|
-
}
|
|
5542
|
+
catch (/** @type {?} */ ee) {
|
|
5543
|
+
rejectPromise(ee);
|
|
5511
5544
|
}
|
|
5512
|
-
}
|
|
5545
|
+
}
|
|
5513
5546
|
});
|
|
5514
5547
|
};
|
|
5515
5548
|
/**
|
|
@@ -7404,7 +7437,7 @@ function provideRouterInitializer() {
|
|
|
7404
7437
|
/**
|
|
7405
7438
|
* \@stable
|
|
7406
7439
|
*/
|
|
7407
|
-
var VERSION = new Version('5.2.
|
|
7440
|
+
var VERSION = new Version('5.2.5');
|
|
7408
7441
|
|
|
7409
7442
|
/**
|
|
7410
7443
|
* @fileoverview added by tsickle
|