@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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v5.2.1
2
+ * @license Angular v5.2.5
3
3
  * (c) 2010-2018 Google, Inc. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v5.2.1
2
+ * @license Angular v5.2.5
3
3
  * (c) 2010-2018 Google, Inc. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/esm5/router.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v5.2.1
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.current.wrap is needed because of the issue with RxJS scheduler,
4779
- // which does not work properly with zone.js in IE and Safari
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(Zone.current.wrap(function (change) {
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
- // applied the new router state
5453
- // this operation has side effects
5454
- var /** @type {?} */ navigationIsSuccessful;
5455
- var /** @type {?} */ storedState = _this.routerState;
5456
- var /** @type {?} */ storedUrl = _this.currentUrlTree;
5457
- routerState$
5458
- .forEach(function (_a) {
5459
- var appliedUrl = _a.appliedUrl, state = _a.state, shouldActivate = _a.shouldActivate;
5460
- if (!shouldActivate || id !== _this.navigationId) {
5461
- navigationIsSuccessful = false;
5462
- return;
5463
- }
5464
- _this.currentUrlTree = appliedUrl;
5465
- _this.rawUrlTree = _this.urlHandlingStrategy.merge(_this.currentUrlTree, rawUrl);
5466
- (/** @type {?} */ (_this)).routerState = state;
5467
- if (!skipLocationChange) {
5468
- var /** @type {?} */ path = _this.urlSerializer.serialize(_this.rawUrlTree);
5469
- if (_this.location.isCurrentPathEqualTo(path) || replaceUrl) {
5470
- _this.location.replaceState(path);
5471
- }
5472
- else {
5473
- _this.location.go(path);
5474
- }
5475
- }
5476
- new ActivateRoutes(_this.routeReuseStrategy, state, storedState, function (evt) { return _this.triggerEvent(evt); })
5477
- .activate(_this.rootContexts);
5478
- navigationIsSuccessful = true;
5479
- })
5480
- .then(function () {
5481
- if (navigationIsSuccessful) {
5482
- _this.navigated = true;
5483
- (/** @type {?} */ (_this.events))
5484
- .next(new NavigationEnd(id, _this.serializeUrl(url), _this.serializeUrl(_this.currentUrlTree)));
5485
- resolvePromise(true);
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.resetUrlToCurrentUrlTree();
5489
- (/** @type {?} */ (_this.events))
5490
- .next(new NavigationCancel(id, _this.serializeUrl(url), ''));
5491
- resolvePromise(false);
5507
+ _this.location.go(path);
5492
5508
  }
5493
- }, function (e) {
5494
- if (isNavigationCancelingError(e)) {
5495
- _this.navigated = true;
5496
- _this.resetStateAndUrl(storedState, storedUrl, rawUrl);
5497
- (/** @type {?} */ (_this.events))
5498
- .next(new NavigationCancel(id, _this.serializeUrl(url), e.message));
5499
- resolvePromise(false);
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
- else {
5502
- _this.resetStateAndUrl(storedState, storedUrl, rawUrl);
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.1');
7440
+ var VERSION = new Version('5.2.5');
7408
7441
 
7409
7442
  /**
7410
7443
  * @fileoverview added by tsickle