@angular/router 15.0.0 → 15.0.2

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 (40) hide show
  1. package/esm2020/src/components/empty_outlet.mjs +3 -3
  2. package/esm2020/src/deprecated_load_children.mjs +3 -1
  3. package/esm2020/src/directives/router_link.mjs +3 -3
  4. package/esm2020/src/directives/router_link_active.mjs +3 -3
  5. package/esm2020/src/directives/router_outlet.mjs +5 -5
  6. package/esm2020/src/index.mjs +1 -1
  7. package/esm2020/src/models.mjs +1 -1
  8. package/esm2020/src/navigation_transition.mjs +380 -0
  9. package/esm2020/src/operators/activate_routes.mjs +1 -1
  10. package/esm2020/src/operators/apply_redirects.mjs +1 -1
  11. package/esm2020/src/operators/check_guards.mjs +1 -1
  12. package/esm2020/src/operators/recognize.mjs +1 -1
  13. package/esm2020/src/operators/resolve_data.mjs +1 -1
  14. package/esm2020/src/page_title_strategy.mjs +6 -6
  15. package/esm2020/src/private_export.mjs +1 -1
  16. package/esm2020/src/provide_router.mjs +11 -15
  17. package/esm2020/src/route_reuse_strategy.mjs +15 -1
  18. package/esm2020/src/router.mjs +76 -407
  19. package/esm2020/src/router_config_loader.mjs +3 -3
  20. package/esm2020/src/router_module.mjs +9 -7
  21. package/esm2020/src/router_outlet_context.mjs +3 -3
  22. package/esm2020/src/router_preloader.mjs +9 -9
  23. package/esm2020/src/router_scroller.mjs +20 -21
  24. package/esm2020/src/router_state.mjs +1 -1
  25. package/esm2020/src/url_handling_strategy.mjs +15 -1
  26. package/esm2020/src/url_tree.mjs +4 -4
  27. package/esm2020/src/version.mjs +1 -1
  28. package/esm2020/testing/src/router_testing_module.mjs +4 -4
  29. package/fesm2015/router.mjs +790 -732
  30. package/fesm2015/router.mjs.map +1 -1
  31. package/fesm2015/testing.mjs +5 -5
  32. package/fesm2015/upgrade.mjs +1 -1
  33. package/fesm2020/router.mjs +794 -735
  34. package/fesm2020/router.mjs.map +1 -1
  35. package/fesm2020/testing.mjs +5 -5
  36. package/fesm2020/upgrade.mjs +1 -1
  37. package/index.d.ts +24 -80
  38. package/package.json +4 -4
  39. package/testing/index.d.ts +1 -1
  40. package/upgrade/index.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0
2
+ * @license Angular v15.0.2
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", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
105
- RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
106
- RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: RouterTestingModule, providers: [
104
+ RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
105
+ RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.2", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
106
+ RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.2", 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", ngImport: i0, type: RouterTestingModule, decorators: [{
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", 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
2
+ * @license Angular v15.0.2
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
2
+ * @license Angular v15.0.2
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
@@ -1312,7 +1312,7 @@ export declare interface IsActiveMatchOptions {
1312
1312
  * @see `LoadChildrenCallback`
1313
1313
  * @publicApi
1314
1314
  */
1315
- export declare type LoadChildren = LoadChildrenCallback | ɵDeprecatedLoadChildren;
1315
+ export declare type LoadChildren = LoadChildrenCallback;
1316
1316
 
1317
1317
  /**
1318
1318
  *
@@ -2494,55 +2494,13 @@ 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;
2497
+ private readonly urlSerializer;
2498
+ private readonly rootContexts;
2499
+ private readonly location;
2501
2500
  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
- private navigations;
2541
- private lastSuccessfulNavigation;
2542
- private currentNavigation;
2543
2501
  private disposed;
2544
2502
  private locationSubscription?;
2545
- private navigationId;
2503
+ private get navigationId();
2546
2504
  /**
2547
2505
  * The id of the currently active page in the router.
2548
2506
  * Updated to the transition's target id on a successful navigation.
@@ -2558,14 +2516,12 @@ export declare class Router {
2558
2516
  * page id in the browser history is 1 more than the previous entry.
2559
2517
  */
2560
2518
  private get browserPageId();
2561
- private configLoader;
2562
- private ngModule;
2563
2519
  private console;
2564
2520
  private isNgZoneEnabled;
2565
2521
  /**
2566
- * An event stream for routing events in this NgModule.
2522
+ * An event stream for routing events.
2567
2523
  */
2568
- readonly events: Observable<Event_2>;
2524
+ get events(): Observable<Event_2>;
2569
2525
  /**
2570
2526
  * The current state of routing in this NgModule.
2571
2527
  */
@@ -2655,12 +2611,13 @@ export declare class Router {
2655
2611
  *
2656
2612
  */
2657
2613
  canceledNavigationResolution: 'replace' | 'computed';
2614
+ private readonly navigationTransitions;
2658
2615
  /**
2659
2616
  * Creates the router service.
2660
2617
  */
2661
- constructor(rootComponentType: Type<any> | null, urlSerializer: UrlSerializer, rootContexts: ChildrenOutletContexts, location: Location_2, injector: Injector, compiler: Compiler, config: Routes);
2662
- private setupNavigations;
2663
- private setTransition;
2618
+ constructor(
2619
+ /** @internal */
2620
+ rootComponentType: Type<any> | null, urlSerializer: UrlSerializer, rootContexts: ChildrenOutletContexts, location: Location_2, injector: Injector, compiler: Compiler, config: Routes);
2664
2621
  /**
2665
2622
  * Sets up the location change listener and performs the initial navigation.
2666
2623
  */
@@ -2825,17 +2782,8 @@ export declare class Router {
2825
2782
  */
2826
2783
  isActive(url: string | UrlTree, matchOptions: IsActiveMatchOptions): boolean;
2827
2784
  private removeEmptyProps;
2828
- 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
2785
  private resetState;
2837
2786
  private resetUrlToCurrentUrlTree;
2838
- private cancelNavigationTransition;
2839
2787
  private generateNgRouterState;
2840
2788
  static ɵfac: i0.ɵɵFactoryDeclaration<Router, never>;
2841
2789
  static ɵprov: i0.ɵɵInjectableDeclaration<Router>;
@@ -2964,6 +2912,8 @@ export declare abstract class RouteReuseStrategy {
2964
2912
  abstract retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null;
2965
2913
  /** Determines if a route should be reused */
2966
2914
  abstract shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;
2915
+ static ɵfac: i0.ɵɵFactoryDeclaration<RouteReuseStrategy, never>;
2916
+ static ɵprov: i0.ɵɵInjectableDeclaration<RouteReuseStrategy>;
2967
2917
  }
2968
2918
 
2969
2919
  /**
@@ -3915,7 +3865,7 @@ export declare interface UrlCreationOptions {
3915
3865
  * constructor(private router: Router, private route: ActivatedRoute) {}
3916
3866
  *
3917
3867
  * go() {
3918
- * this.router.navigate(['../list'], { relativeTo: this.route });
3868
+ * router.navigate(['../list'], { relativeTo: this.route });
3919
3869
  * }
3920
3870
  * }
3921
3871
  * ```
@@ -3929,7 +3879,7 @@ export declare interface UrlCreationOptions {
3929
3879
  *
3930
3880
  * ```
3931
3881
  * // Navigate to /results?page=1
3932
- * this.router.navigate(['/results'], { queryParams: { page: 1 } });
3882
+ * router.navigate(['/results'], { queryParams: { page: 1 } });
3933
3883
  * ```
3934
3884
  */
3935
3885
  queryParams?: Params | null;
@@ -3938,7 +3888,7 @@ export declare interface UrlCreationOptions {
3938
3888
  *
3939
3889
  * ```
3940
3890
  * // Navigate to /results#top
3941
- * this.router.navigate(['/results'], { fragment: 'top' });
3891
+ * router.navigate(['/results'], { fragment: 'top' });
3942
3892
  * ```
3943
3893
  */
3944
3894
  fragment?: string;
@@ -3951,13 +3901,13 @@ export declare interface UrlCreationOptions {
3951
3901
  * The "preserve" option discards any new query params:
3952
3902
  * ```
3953
3903
  * // from /view1?page=1 to/view2?page=1
3954
- * this.router.navigate(['/view2'], { queryParams: { page: 2 }, queryParamsHandling: "preserve"
3904
+ * router.navigate(['/view2'], { queryParams: { page: 2 }, queryParamsHandling: "preserve"
3955
3905
  * });
3956
3906
  * ```
3957
3907
  * The "merge" option appends new query params to the params from the current URL:
3958
3908
  * ```
3959
3909
  * // from /view1?page=1 to/view2?page=1&otherKey=2
3960
- * this.router.navigate(['/view2'], { queryParams: { otherKey: 2 }, queryParamsHandling: "merge"
3910
+ * router.navigate(['/view2'], { queryParams: { otherKey: 2 }, queryParamsHandling: "merge"
3961
3911
  * });
3962
3912
  * ```
3963
3913
  * In case of a key collision between current parameters and those in the `queryParams` object,
@@ -3970,7 +3920,7 @@ export declare interface UrlCreationOptions {
3970
3920
  *
3971
3921
  * ```
3972
3922
  * // Preserve fragment from /results#top to /view#top
3973
- * this.router.navigate(['/view'], { preserveFragment: true });
3923
+ * router.navigate(['/view'], { preserveFragment: true });
3974
3924
  * ```
3975
3925
  */
3976
3926
  preserveFragment?: boolean;
@@ -4002,6 +3952,8 @@ export declare abstract class UrlHandlingStrategy {
4002
3952
  * Merges the URL fragment with the rest of the URL.
4003
3953
  */
4004
3954
  abstract merge(newUrlPart: UrlTree, rawUrl: UrlTree): UrlTree;
3955
+ static ɵfac: i0.ɵɵFactoryDeclaration<UrlHandlingStrategy, never>;
3956
+ static ɵprov: i0.ɵɵInjectableDeclaration<UrlHandlingStrategy>;
4005
3957
  }
4006
3958
 
4007
3959
  /**
@@ -4366,14 +4318,6 @@ export declare function withRouterConfig(options: RouterConfigOptions): RouterCo
4366
4318
 
4367
4319
  export declare function ɵassignExtraOptionsToRouter(opts: ExtraOptions, router: Router): void;
4368
4320
 
4369
- /**
4370
- * Deprecated `loadChildren` value types.
4371
- *
4372
- * @publicApi
4373
- * @deprecated represents the deprecated type side of `LoadChildren`.
4374
- */
4375
- export declare type ɵDeprecatedLoadChildren = never;
4376
-
4377
4321
  /**
4378
4322
  * This component is used internally within the router to be a placeholder when an empty
4379
4323
  * router-outlet is needed. For example, with a config such as:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/router",
3
- "version": "15.0.0",
3
+ "version": "15.0.2",
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",
28
- "@angular/common": "15.0.0",
29
- "@angular/platform-browser": "15.0.0",
27
+ "@angular/core": "15.0.2",
28
+ "@angular/common": "15.0.2",
29
+ "@angular/platform-browser": "15.0.2",
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
2
+ * @license Angular v15.0.2
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
2
+ * @license Angular v15.0.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */