@angular/router 15.0.0-rc.4 → 15.0.1

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.
Files changed (38) hide show
  1. package/esm2020/src/components/empty_outlet.mjs +3 -3
  2. package/esm2020/src/directives/router_link.mjs +3 -3
  3. package/esm2020/src/directives/router_link_active.mjs +3 -3
  4. package/esm2020/src/directives/router_outlet.mjs +5 -5
  5. package/esm2020/src/index.mjs +1 -1
  6. package/esm2020/src/models.mjs +1 -1
  7. package/esm2020/src/navigation_transition.mjs +320 -0
  8. package/esm2020/src/operators/activate_routes.mjs +1 -1
  9. package/esm2020/src/operators/apply_redirects.mjs +1 -1
  10. package/esm2020/src/operators/check_guards.mjs +1 -1
  11. package/esm2020/src/operators/recognize.mjs +1 -1
  12. package/esm2020/src/operators/resolve_data.mjs +1 -1
  13. package/esm2020/src/page_title_strategy.mjs +6 -6
  14. package/esm2020/src/private_export.mjs +1 -1
  15. package/esm2020/src/provide_router.mjs +6 -13
  16. package/esm2020/src/route_reuse_strategy.mjs +15 -1
  17. package/esm2020/src/router.mjs +66 -347
  18. package/esm2020/src/router_config_loader.mjs +3 -3
  19. package/esm2020/src/router_module.mjs +4 -4
  20. package/esm2020/src/router_outlet_context.mjs +3 -3
  21. package/esm2020/src/router_preloader.mjs +9 -9
  22. package/esm2020/src/router_scroller.mjs +3 -3
  23. package/esm2020/src/url_handling_strategy.mjs +15 -1
  24. package/esm2020/src/url_tree.mjs +3 -3
  25. package/esm2020/src/version.mjs +1 -1
  26. package/esm2020/testing/src/router_testing_module.mjs +4 -4
  27. package/fesm2015/router.mjs +448 -402
  28. package/fesm2015/router.mjs.map +1 -1
  29. package/fesm2015/testing.mjs +5 -5
  30. package/fesm2015/upgrade.mjs +1 -1
  31. package/fesm2020/router.mjs +462 -411
  32. package/fesm2020/router.mjs.map +1 -1
  33. package/fesm2020/testing.mjs +5 -5
  34. package/fesm2020/upgrade.mjs +1 -1
  35. package/index.d.ts +17 -60
  36. package/package.json +4 -4
  37. package/testing/index.d.ts +1 -1
  38. package/upgrade/index.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0-rc.4
2
+ * @license Angular v15.0.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -101,9 +101,9 @@ class RouterTestingModule {
101
101
  };
102
102
  }
103
103
  }
104
- RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
105
- RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
106
- RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterTestingModule, providers: [
104
+ RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
105
+ RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.1", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
106
+ RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: RouterTestingModule, providers: [
107
107
  ɵROUTER_PROVIDERS,
108
108
  EXTRA_ROUTER_TESTING_PROVIDERS,
109
109
  provideLocationMocks(),
@@ -126,7 +126,7 @@ RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
126
126
  ɵwithPreloading(NoPreloading).ɵproviders,
127
127
  { provide: ROUTES, multi: true, useValue: [] },
128
128
  ], imports: [RouterModule] });
129
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterTestingModule, decorators: [{
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: RouterTestingModule, decorators: [{
130
130
  type: NgModule,
131
131
  args: [{
132
132
  exports: [RouterModule],
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0-rc.4
2
+ * @license Angular v15.0.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0-rc.4
2
+ * @license Angular v15.0.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -498,7 +498,7 @@ export declare type CanActivateFn = (route: ActivatedRouteSnapshot, state: Route
498
498
  * @publicApi
499
499
  */
500
500
  export declare interface CanDeactivate<T> {
501
- canDeactivate(component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
501
+ canDeactivate(component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
502
502
  }
503
503
 
504
504
  /**
@@ -508,7 +508,7 @@ export declare interface CanDeactivate<T> {
508
508
  * @see `CanDeactivate`
509
509
  * @see `Route`
510
510
  */
511
- export declare type CanDeactivateFn<T> = (component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
511
+ export declare type CanDeactivateFn<T> = (component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState: RouterStateSnapshot) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
512
512
 
513
513
  /**
514
514
  * @description
@@ -2494,55 +2494,10 @@ export declare class RouteConfigLoadStart {
2494
2494
  * @publicApi
2495
2495
  */
2496
2496
  export declare class Router {
2497
- private rootComponentType;
2498
- private urlSerializer;
2499
- private rootContexts;
2500
- private location;
2501
2497
  config: Routes;
2502
- /**
2503
- * Represents the activated `UrlTree` that the `Router` is configured to handle (through
2504
- * `UrlHandlingStrategy`). That is, after we find the route config tree that we're going to
2505
- * activate, run guards, and are just about to activate the route, we set the currentUrlTree.
2506
- *
2507
- * This should match the `browserUrlTree` when a navigation succeeds. If the
2508
- * `UrlHandlingStrategy.shouldProcessUrl` is `false`, only the `browserUrlTree` is updated.
2509
- */
2510
- private currentUrlTree;
2511
- /**
2512
- * Meant to represent the entire browser url after a successful navigation. In the life of a
2513
- * navigation transition:
2514
- * 1. The rawUrl represents the full URL that's being navigated to
2515
- * 2. We apply redirects, which might only apply to _part_ of the URL (due to
2516
- * `UrlHandlingStrategy`).
2517
- * 3. Right before activation (because we assume activation will succeed), we update the
2518
- * rawUrlTree to be a combination of the urlAfterRedirects (again, this might only apply to part
2519
- * of the initial url) and the rawUrl of the transition (which was the original navigation url in
2520
- * its full form).
2521
- */
2522
- private rawUrlTree;
2523
- /**
2524
- * Meant to represent the part of the browser url that the `Router` is set up to handle (via the
2525
- * `UrlHandlingStrategy`). This value is updated immediately after the browser url is updated (or
2526
- * the browser url update is skipped via `skipLocationChange`). With that, note that
2527
- * `browserUrlTree` _may not_ reflect the actual browser URL for two reasons:
2528
- *
2529
- * 1. `UrlHandlingStrategy` only handles part of the URL
2530
- * 2. `skipLocationChange` does not update the browser url.
2531
- *
2532
- * So to reiterate, `browserUrlTree` only represents the Router's internal understanding of the
2533
- * current route, either before guards with `urlUpdateStrategy === 'eager'` or right before
2534
- * activation with `'deferred'`.
2535
- *
2536
- * This should match the `currentUrlTree` when the navigation succeeds.
2537
- */
2538
- private browserUrlTree;
2539
- private readonly transitions;
2540
2498
  private navigations;
2541
- private lastSuccessfulNavigation;
2542
- private currentNavigation;
2543
2499
  private disposed;
2544
2500
  private locationSubscription?;
2545
- private navigationId;
2546
2501
  /**
2547
2502
  * The id of the currently active page in the router.
2548
2503
  * Updated to the transition's target id on a successful navigation.
@@ -2558,8 +2513,6 @@ export declare class Router {
2558
2513
  * page id in the browser history is 1 more than the previous entry.
2559
2514
  */
2560
2515
  private get browserPageId();
2561
- private configLoader;
2562
- private ngModule;
2563
2516
  private console;
2564
2517
  private isNgZoneEnabled;
2565
2518
  /**
@@ -2655,11 +2608,19 @@ export declare class Router {
2655
2608
  *
2656
2609
  */
2657
2610
  canceledNavigationResolution: 'replace' | 'computed';
2611
+ private readonly navigationTransitions;
2658
2612
  /**
2659
2613
  * Creates the router service.
2660
2614
  */
2661
- constructor(rootComponentType: Type<any> | null, urlSerializer: UrlSerializer, rootContexts: ChildrenOutletContexts, location: Location_2, injector: Injector, compiler: Compiler, config: Routes);
2662
- private setupNavigations;
2615
+ constructor(
2616
+ /** @internal */
2617
+ rootComponentType: Type<any> | null,
2618
+ /** @internal */
2619
+ urlSerializer: UrlSerializer,
2620
+ /** @internal */
2621
+ rootContexts: ChildrenOutletContexts,
2622
+ /** @internal */
2623
+ location: Location_2, injector: Injector, compiler: Compiler, config: Routes);
2663
2624
  private setTransition;
2664
2625
  /**
2665
2626
  * Sets up the location change listener and performs the initial navigation.
@@ -2826,16 +2787,8 @@ export declare class Router {
2826
2787
  isActive(url: string | UrlTree, matchOptions: IsActiveMatchOptions): boolean;
2827
2788
  private removeEmptyProps;
2828
2789
  private processNavigations;
2829
- private scheduleNavigation;
2830
- private setBrowserUrl;
2831
- /**
2832
- * Performs the necessary rollback action to restore the browser URL to the
2833
- * state before the transition.
2834
- */
2835
- private restoreHistory;
2836
2790
  private resetState;
2837
2791
  private resetUrlToCurrentUrlTree;
2838
- private cancelNavigationTransition;
2839
2792
  private generateNgRouterState;
2840
2793
  static ɵfac: i0.ɵɵFactoryDeclaration<Router, never>;
2841
2794
  static ɵprov: i0.ɵɵInjectableDeclaration<Router>;
@@ -2964,6 +2917,8 @@ export declare abstract class RouteReuseStrategy {
2964
2917
  abstract retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null;
2965
2918
  /** Determines if a route should be reused */
2966
2919
  abstract shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;
2920
+ static ɵfac: i0.ɵɵFactoryDeclaration<RouteReuseStrategy, never>;
2921
+ static ɵprov: i0.ɵɵInjectableDeclaration<RouteReuseStrategy>;
2967
2922
  }
2968
2923
 
2969
2924
  /**
@@ -4002,6 +3957,8 @@ export declare abstract class UrlHandlingStrategy {
4002
3957
  * Merges the URL fragment with the rest of the URL.
4003
3958
  */
4004
3959
  abstract merge(newUrlPart: UrlTree, rawUrl: UrlTree): UrlTree;
3960
+ static ɵfac: i0.ɵɵFactoryDeclaration<UrlHandlingStrategy, never>;
3961
+ static ɵprov: i0.ɵɵInjectableDeclaration<UrlHandlingStrategy>;
4005
3962
  }
4006
3963
 
4007
3964
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/router",
3
- "version": "15.0.0-rc.4",
3
+ "version": "15.0.1",
4
4
  "description": "Angular - the routing library",
5
5
  "keywords": [
6
6
  "angular",
@@ -24,9 +24,9 @@
24
24
  "tslib": "^2.3.0"
25
25
  },
26
26
  "peerDependencies": {
27
- "@angular/core": "15.0.0-rc.4",
28
- "@angular/common": "15.0.0-rc.4",
29
- "@angular/platform-browser": "15.0.0-rc.4",
27
+ "@angular/core": "15.0.1",
28
+ "@angular/common": "15.0.1",
29
+ "@angular/platform-browser": "15.0.1",
30
30
  "rxjs": "^6.5.3 || ^7.4.0"
31
31
  },
32
32
  "ng-update": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0-rc.4
2
+ * @license Angular v15.0.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0-rc.4
2
+ * @license Angular v15.0.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */