@angular/router 13.0.0-rc.0 → 13.0.0

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 v13.0.0-rc.0
2
+ * @license Angular v13.0.0
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1679,7 +1679,8 @@ function createNode(routeReuseStrategy, curr, prevState) {
1679
1679
  const detachedRouteHandle = routeReuseStrategy.retrieve(curr.value);
1680
1680
  if (detachedRouteHandle !== null) {
1681
1681
  const tree = detachedRouteHandle.route;
1682
- setFutureSnapshotsOfActivatedRoutes(curr, tree);
1682
+ tree.value._futureSnapshot = curr.value;
1683
+ tree.children = curr.children.map(c => createNode(routeReuseStrategy, c));
1683
1684
  return tree;
1684
1685
  }
1685
1686
  }
@@ -1688,18 +1689,6 @@ function createNode(routeReuseStrategy, curr, prevState) {
1688
1689
  return new TreeNode(value, children);
1689
1690
  }
1690
1691
  }
1691
- function setFutureSnapshotsOfActivatedRoutes(curr, result) {
1692
- if (curr.value.routeConfig !== result.value.routeConfig) {
1693
- throw new Error('Cannot reattach ActivatedRouteSnapshot created from a different route');
1694
- }
1695
- if (curr.children.length !== result.children.length) {
1696
- throw new Error('Cannot reattach ActivatedRouteSnapshot with a different number of children');
1697
- }
1698
- result.value._futureSnapshot = curr.value;
1699
- for (let i = 0; i < curr.children.length; ++i) {
1700
- setFutureSnapshotsOfActivatedRoutes(curr.children[i], result.children[i]);
1701
- }
1702
- }
1703
1692
  function createOrReuseChildren(routeReuseStrategy, curr, prevState) {
1704
1693
  return curr.children.map(child => {
1705
1694
  for (const p of prevState.children) {
@@ -2081,6 +2070,11 @@ class ActivateRoutes {
2081
2070
  }
2082
2071
  detachAndStoreRouteSubtree(route, parentContexts) {
2083
2072
  const context = parentContexts.getContext(route.value.outlet);
2073
+ const contexts = context && route.value.component ? context.children : parentContexts;
2074
+ const children = nodeChildrenAsMap(route);
2075
+ for (const childOutlet of Object.keys(children)) {
2076
+ this.deactivateRouteAndItsChildren(children[childOutlet], contexts);
2077
+ }
2084
2078
  if (context && context.outlet) {
2085
2079
  const componentRef = context.outlet.detach();
2086
2080
  const contexts = context.children.onOutletDeactivated();
@@ -2149,7 +2143,8 @@ class ActivateRoutes {
2149
2143
  // Otherwise attach from `RouterOutlet.ngOnInit` when it is instantiated
2150
2144
  context.outlet.attach(stored.componentRef, stored.route.value);
2151
2145
  }
2152
- advanceActivatedRouteNodeAndItsChildren(stored.route);
2146
+ advanceActivatedRoute(stored.route.value);
2147
+ this.activateChildRoutes(futureNode, null, context.children);
2153
2148
  }
2154
2149
  else {
2155
2150
  const config = parentLoadedConfig(future.snapshot);
@@ -2172,10 +2167,6 @@ class ActivateRoutes {
2172
2167
  }
2173
2168
  }
2174
2169
  }
2175
- function advanceActivatedRouteNodeAndItsChildren(node) {
2176
- advanceActivatedRoute(node.value);
2177
- node.children.forEach(advanceActivatedRouteNodeAndItsChildren);
2178
- }
2179
2170
  function parentLoadedConfig(snapshot) {
2180
2171
  for (let s = snapshot.parent; s; s = s.parent) {
2181
2172
  const route = s.routeConfig;
@@ -2531,9 +2522,9 @@ class RouterOutlet {
2531
2522
  this.activateEvents.emit(this.activated.instance);
2532
2523
  }
2533
2524
  }
2534
- RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: i0.ComponentFactoryResolver }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
2535
- RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-rc.0", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
2536
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterOutlet, decorators: [{
2525
+ RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: i0.ComponentFactoryResolver }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
2526
+ RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
2527
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterOutlet, decorators: [{
2537
2528
  type: Directive,
2538
2529
  args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
2539
2530
  }], ctorParameters: function () {
@@ -2589,9 +2580,9 @@ class OutletInjector {
2589
2580
  */
2590
2581
  class ɵEmptyOutletComponent {
2591
2582
  }
2592
- ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2593
- ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0-rc.0", type: ɵEmptyOutletComponent, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, directives: [{ type: RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
2594
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
2583
+ ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2584
+ ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: ɵEmptyOutletComponent, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, directives: [{ type: RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
2585
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
2595
2586
  type: Component,
2596
2587
  args: [{ template: `<router-outlet></router-outlet>` }]
2597
2588
  }] });
@@ -4426,6 +4417,7 @@ class Router {
4426
4417
  completed = true;
4427
4418
  }
4428
4419
  }), finalize(() => {
4420
+ var _a;
4429
4421
  /* When the navigation stream finishes either through error or success, we
4430
4422
  * set the `completed` or `errored` flag. However, there are some situations
4431
4423
  * where we could get here without either of those being set. For instance, a
@@ -4437,10 +4429,11 @@ class Router {
4437
4429
  const cancelationReason = `Navigation ID ${t.id} is not equal to the current navigation id ${this.navigationId}`;
4438
4430
  this.cancelNavigationTransition(t, cancelationReason);
4439
4431
  }
4440
- // currentNavigation should always be reset to null here. If navigation was
4441
- // successful, lastSuccessfulTransition will have already been set. Therefore
4442
- // we can safely set currentNavigation to null here.
4443
- this.currentNavigation = null;
4432
+ // Only clear current navigation if it is still set to the one that
4433
+ // finalized.
4434
+ if (((_a = this.currentNavigation) === null || _a === void 0 ? void 0 : _a.id) === t.id) {
4435
+ this.currentNavigation = null;
4436
+ }
4444
4437
  }), catchError((e) => {
4445
4438
  // TODO(atscott): The NavigationTransition `t` used here does not accurately
4446
4439
  // reflect the current state of the whole transition because some operations
@@ -4465,7 +4458,7 @@ class Router {
4465
4458
  // This is only applicable with initial navigation, so setting
4466
4459
  // `navigated` only when not redirecting resolves this scenario.
4467
4460
  this.navigated = true;
4468
- this.restoreHistory(t);
4461
+ this.restoreHistory(t, true);
4469
4462
  }
4470
4463
  const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), e.message);
4471
4464
  eventsSubject.next(navCancel);
@@ -4497,7 +4490,7 @@ class Router {
4497
4490
  * the pre-error state. */
4498
4491
  }
4499
4492
  else {
4500
- this.restoreHistory(t);
4493
+ this.restoreHistory(t, true);
4501
4494
  const navError = new NavigationError(t.id, this.serializeUrl(t.extractedUrl), e);
4502
4495
  eventsSubject.next(navError);
4503
4496
  try {
@@ -4816,26 +4809,18 @@ class Router {
4816
4809
  if (this.disposed) {
4817
4810
  return Promise.resolve(false);
4818
4811
  }
4819
- // * Duplicate navigations may also be triggered by attempts to sync AngularJS and Angular
4820
- // router states.
4821
- // * Imperative navigations can be cancelled by router guards, meaning the URL won't change. If
4822
- // the user follows that with a navigation using the back/forward button or manual URL change,
4823
- // the destination may be the same as the previous imperative attempt. We should not skip
4824
- // these navigations because it's a separate case from the one above -- it's not a duplicate
4825
- // navigation.
4812
+ // Duplicate navigations may be triggered by attempts to sync AngularJS and
4813
+ // Angular router states. We have the setTimeout in the location listener to
4814
+ // ensure the imperative nav is scheduled before the browser nav.
4826
4815
  const lastNavigation = this.transitions.value;
4827
- // We don't want to skip duplicate successful navs if they're imperative because
4828
- // onSameUrlNavigation could be 'reload' (so the duplicate is intended).
4829
4816
  const browserNavPrecededByRouterNav = isBrowserTriggeredNavigation(source) && lastNavigation &&
4830
4817
  !isBrowserTriggeredNavigation(lastNavigation.source);
4831
- const lastNavigationSucceeded = this.lastSuccessfulId === lastNavigation.id;
4832
- // If the last navigation succeeded or is in flight, we can use the rawUrl as the comparison.
4833
- // However, if it failed, we should compare to the final result (urlAfterRedirects).
4834
- const lastNavigationUrl = (lastNavigationSucceeded || this.currentNavigation) ?
4835
- lastNavigation.rawUrl :
4836
- ((_a = lastNavigation.urlAfterRedirects) !== null && _a !== void 0 ? _a : this.browserUrlTree);
4837
- const duplicateNav = lastNavigationUrl.toString() === rawUrl.toString();
4838
- if (browserNavPrecededByRouterNav && duplicateNav) {
4818
+ const navToSameUrl = lastNavigation.rawUrl.toString() === rawUrl.toString();
4819
+ const lastNavigationInProgress = lastNavigation.id === ((_a = this.currentNavigation) === null || _a === void 0 ? void 0 : _a.id);
4820
+ // We consider duplicates as ones that goes to the same URL while the first
4821
+ // is still processing.
4822
+ const isDuplicateNav = navToSameUrl && lastNavigationInProgress;
4823
+ if (browserNavPrecededByRouterNav && isDuplicateNav) {
4839
4824
  return Promise.resolve(true); // return value is not used
4840
4825
  }
4841
4826
  let resolve;
@@ -4915,7 +4900,7 @@ class Router {
4915
4900
  * Performs the necessary rollback action to restore the browser URL to the
4916
4901
  * state before the transition.
4917
4902
  */
4918
- restoreHistory(t) {
4903
+ restoreHistory(t, restoringFromCaughtError = false) {
4919
4904
  var _a, _b;
4920
4905
  if (this.canceledNavigationResolution === 'computed') {
4921
4906
  const targetPagePosition = this.currentPageId - t.targetPageId;
@@ -4937,6 +4922,7 @@ class Router {
4937
4922
  // TODO(atscott): resetting the `browserUrlTree` should really be done in `resetState`.
4938
4923
  // Investigate if this can be done by running TGP.
4939
4924
  this.browserUrlTree = t.currentUrlTree;
4925
+ this.resetUrlToCurrentUrlTree();
4940
4926
  }
4941
4927
  else {
4942
4928
  // The browser URL and router state was not updated before the navigation cancelled so
@@ -4944,7 +4930,14 @@ class Router {
4944
4930
  }
4945
4931
  }
4946
4932
  else if (this.canceledNavigationResolution === 'replace') {
4947
- this.resetState(t);
4933
+ // TODO(atscott): It seems like we should _always_ reset the state here. It would be a no-op
4934
+ // for `deferred` navigations that haven't change the internal state yet because guards
4935
+ // reject. For 'eager' navigations, it seems like we also really should reset the state
4936
+ // because the navigation was cancelled. Investigate if this can be done by running TGP.
4937
+ if (restoringFromCaughtError) {
4938
+ this.resetState(t);
4939
+ }
4940
+ this.resetUrlToCurrentUrlTree();
4948
4941
  }
4949
4942
  }
4950
4943
  resetState(t) {
@@ -4956,7 +4949,6 @@ class Router {
4956
4949
  // addition, the URLHandlingStrategy may be configured to specifically preserve parts of the URL
4957
4950
  // when merging, such as the query params so they are not lost on a refresh.
4958
4951
  this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, t.rawUrl);
4959
- this.resetUrlToCurrentUrlTree();
4960
4952
  }
4961
4953
  resetUrlToCurrentUrlTree() {
4962
4954
  this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree), '', this.generateNgRouterState(this.lastSuccessfulId, this.currentPageId));
@@ -4973,9 +4965,9 @@ class Router {
4973
4965
  return { navigationId };
4974
4966
  }
4975
4967
  }
4976
- Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
4977
- Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: Router });
4978
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: Router, decorators: [{
4968
+ Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
4969
+ Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: Router });
4970
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: Router, decorators: [{
4979
4971
  type: Injectable
4980
4972
  }], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
4981
4973
  function validateCommands(commands) {
@@ -5167,9 +5159,9 @@ class RouterLink {
5167
5159
  });
5168
5160
  }
5169
5161
  }
5170
- RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
5171
- RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-rc.0", type: RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: { queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick()" } }, usesOnChanges: true, ngImport: i0 });
5172
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterLink, decorators: [{
5162
+ RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
5163
+ RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0", type: RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: { queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick()" } }, usesOnChanges: true, ngImport: i0 });
5164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterLink, decorators: [{
5173
5165
  type: Directive,
5174
5166
  args: [{ selector: ':not(a):not(area)[routerLink]' }]
5175
5167
  }], ctorParameters: function () {
@@ -5288,9 +5280,9 @@ class RouterLinkWithHref {
5288
5280
  });
5289
5281
  }
5290
5282
  }
5291
- RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
5292
- RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-rc.0", type: RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target", "attr.href": "this.href" } }, usesOnChanges: true, ngImport: i0 });
5293
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterLinkWithHref, decorators: [{
5283
+ RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
5284
+ RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0", type: RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target", "attr.href": "this.href" } }, usesOnChanges: true, ngImport: i0 });
5285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterLinkWithHref, decorators: [{
5294
5286
  type: Directive,
5295
5287
  args: [{ selector: 'a[routerLink],area[routerLink]' }]
5296
5288
  }], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
@@ -5504,9 +5496,9 @@ class RouterLinkActive {
5504
5496
  this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
5505
5497
  }
5506
5498
  }
5507
- RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }, { token: RouterLinkWithHref, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
5508
- RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-rc.0", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }, { propertyName: "linksWithHrefs", predicate: RouterLinkWithHref, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
5509
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterLinkActive, decorators: [{
5499
+ RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }, { token: RouterLinkWithHref, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
5500
+ RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }, { propertyName: "linksWithHrefs", predicate: RouterLinkWithHref, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
5501
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterLinkActive, decorators: [{
5510
5502
  type: Directive,
5511
5503
  args: [{
5512
5504
  selector: '[routerLinkActive]',
@@ -5651,9 +5643,9 @@ class RouterPreloader {
5651
5643
  });
5652
5644
  }
5653
5645
  }
5654
- RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.Injector }, { token: PreloadingStrategy }], target: i0.ɵɵFactoryTarget.Injectable });
5655
- RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterPreloader });
5656
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterPreloader, decorators: [{
5646
+ RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.Injector }, { token: PreloadingStrategy }], target: i0.ɵɵFactoryTarget.Injectable });
5647
+ RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterPreloader });
5648
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterPreloader, decorators: [{
5657
5649
  type: Injectable
5658
5650
  }], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.Injector }, { type: PreloadingStrategy }]; } });
5659
5651
 
@@ -5732,9 +5724,9 @@ class RouterScroller {
5732
5724
  }
5733
5725
  }
5734
5726
  }
5735
- RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
5736
- RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterScroller });
5737
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterScroller, decorators: [{
5727
+ RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
5728
+ RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterScroller });
5729
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterScroller, decorators: [{
5738
5730
  type: Injectable
5739
5731
  }], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
5740
5732
 
@@ -5875,10 +5867,10 @@ class RouterModule {
5875
5867
  return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
5876
5868
  }
5877
5869
  }
5878
- RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
5879
- RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
5880
- RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterModule });
5881
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterModule, decorators: [{
5870
+ RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
5871
+ RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
5872
+ RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterModule });
5873
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterModule, decorators: [{
5882
5874
  type: NgModule,
5883
5875
  args: [{
5884
5876
  declarations: ROUTER_DIRECTIVES,
@@ -5974,6 +5966,9 @@ function assignExtraOptionsToRouter(opts, router) {
5974
5966
  if (opts.urlUpdateStrategy) {
5975
5967
  router.urlUpdateStrategy = opts.urlUpdateStrategy;
5976
5968
  }
5969
+ if (opts.canceledNavigationResolution) {
5970
+ router.canceledNavigationResolution = opts.canceledNavigationResolution;
5971
+ }
5977
5972
  }
5978
5973
  function rootRoute(router) {
5979
5974
  return router.routerState.root;
@@ -6057,9 +6052,9 @@ class RouterInitializer {
6057
6052
  this.destroyed = true;
6058
6053
  }
6059
6054
  }
6060
- RouterInitializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterInitializer, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
6061
- RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterInitializer });
6062
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.0", ngImport: i0, type: RouterInitializer, decorators: [{
6055
+ RouterInitializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterInitializer, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
6056
+ RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterInitializer });
6057
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: RouterInitializer, decorators: [{
6063
6058
  type: Injectable
6064
6059
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
6065
6060
  function getAppInitializer(r) {
@@ -6099,7 +6094,7 @@ function provideRouterInitializer() {
6099
6094
  /**
6100
6095
  * @publicApi
6101
6096
  */
6102
- const VERSION = new Version('13.0.0-rc.0');
6097
+ const VERSION = new Version('13.0.0');
6103
6098
 
6104
6099
  /**
6105
6100
  * @license