@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/esm2015/router.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v5.2.4
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
- // applied the new router state
4569
- // this operation has side effects
4570
- let /** @type {?} */ navigationIsSuccessful;
4571
- const /** @type {?} */ storedState = this.routerState;
4572
- const /** @type {?} */ storedUrl = this.currentUrlTree;
4573
- routerState$
4574
- .forEach(({ appliedUrl, state, shouldActivate }) => {
4575
- if (!shouldActivate || id !== this.navigationId) {
4576
- navigationIsSuccessful = false;
4577
- return;
4578
- }
4579
- this.currentUrlTree = appliedUrl;
4580
- this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, rawUrl);
4581
- (/** @type {?} */ (this)).routerState = state;
4582
- if (!skipLocationChange) {
4583
- const /** @type {?} */ path = this.urlSerializer.serialize(this.rawUrlTree);
4584
- if (this.location.isCurrentPathEqualTo(path) || replaceUrl) {
4585
- this.location.replaceState(path);
4586
- }
4587
- else {
4588
- this.location.go(path);
4589
- }
4590
- }
4591
- new ActivateRoutes(this.routeReuseStrategy, state, storedState, (evt) => this.triggerEvent(evt))
4592
- .activate(this.rootContexts);
4593
- navigationIsSuccessful = true;
4594
- })
4595
- .then(() => {
4596
- if (navigationIsSuccessful) {
4597
- this.navigated = true;
4598
- (/** @type {?} */ (this.events))
4599
- .next(new NavigationEnd(id, this.serializeUrl(url), this.serializeUrl(this.currentUrlTree)));
4600
- resolvePromise(true);
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.resetUrlToCurrentUrlTree();
4604
- (/** @type {?} */ (this.events))
4605
- .next(new NavigationCancel(id, this.serializeUrl(url), ''));
4606
- resolvePromise(false);
4605
+ this.location.go(path);
4607
4606
  }
4608
- }, (e) => {
4609
- if (isNavigationCancelingError(e)) {
4610
- this.navigated = true;
4611
- this.resetStateAndUrl(storedState, storedUrl, rawUrl);
4612
- (/** @type {?} */ (this.events))
4613
- .next(new NavigationCancel(id, this.serializeUrl(url), e.message));
4614
- resolvePromise(false);
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
- else {
4617
- this.resetStateAndUrl(storedState, storedUrl, rawUrl);
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.4');
6252
+ const VERSION = new Version('5.2.5');
6237
6253
 
6238
6254
  /**
6239
6255
  * @fileoverview added by tsickle