@angular/router 18.0.0-next.1 → 18.0.0-next.3

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 (32) hide show
  1. package/esm2022/src/components/empty_outlet.mjs +3 -3
  2. package/esm2022/src/directives/router_link.mjs +3 -3
  3. package/esm2022/src/directives/router_link_active.mjs +19 -18
  4. package/esm2022/src/directives/router_outlet.mjs +16 -10
  5. package/esm2022/src/models.mjs +1 -1
  6. package/esm2022/src/navigation_transition.mjs +16 -11
  7. package/esm2022/src/operators/activate_routes.mjs +2 -2
  8. package/esm2022/src/operators/resolve_data.mjs +7 -1
  9. package/esm2022/src/page_title_strategy.mjs +6 -6
  10. package/esm2022/src/provide_router.mjs +9 -18
  11. package/esm2022/src/route_reuse_strategy.mjs +6 -6
  12. package/esm2022/src/router.mjs +8 -7
  13. package/esm2022/src/router_config.mjs +2 -2
  14. package/esm2022/src/router_config_loader.mjs +5 -5
  15. package/esm2022/src/router_module.mjs +6 -6
  16. package/esm2022/src/router_outlet_context.mjs +13 -11
  17. package/esm2022/src/router_preloader.mjs +9 -9
  18. package/esm2022/src/router_scroller.mjs +3 -3
  19. package/esm2022/src/statemanager/state_manager.mjs +6 -6
  20. package/esm2022/src/url_handling_strategy.mjs +6 -6
  21. package/esm2022/src/url_tree.mjs +3 -3
  22. package/esm2022/src/version.mjs +1 -1
  23. package/esm2022/testing/src/router_testing_harness.mjs +6 -6
  24. package/esm2022/testing/src/router_testing_module.mjs +4 -4
  25. package/fesm2022/router.mjs +131 -122
  26. package/fesm2022/router.mjs.map +1 -1
  27. package/fesm2022/testing.mjs +11 -11
  28. package/fesm2022/upgrade.mjs +1 -1
  29. package/index.d.ts +20 -13
  30. package/package.json +4 -4
  31. package/testing/index.d.ts +1 -1
  32. package/upgrade/index.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.0.0-next.1
2
+ * @license Angular v18.0.0-next.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -59,16 +59,16 @@ class RouterTestingModule {
59
59
  ],
60
60
  };
61
61
  }
62
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.1", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
63
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.1", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] }); }
64
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.1", ngImport: i0, type: RouterTestingModule, providers: [
62
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
63
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.3", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] }); }
64
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: RouterTestingModule, providers: [
65
65
  ɵROUTER_PROVIDERS,
66
66
  provideLocationMocks(),
67
67
  withPreloading(NoPreloading).ɵproviders,
68
68
  { provide: ROUTES, multi: true, useValue: [] },
69
69
  ], imports: [RouterModule] }); }
70
70
  }
71
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.1", ngImport: i0, type: RouterTestingModule, decorators: [{
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: RouterTestingModule, decorators: [{
72
72
  type: NgModule,
73
73
  args: [{
74
74
  exports: [RouterModule],
@@ -97,18 +97,18 @@ class RootFixtureService {
97
97
  this.fixture.detectChanges();
98
98
  return this.fixture;
99
99
  }
100
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.1", ngImport: i0, type: RootFixtureService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
101
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.1", ngImport: i0, type: RootFixtureService, providedIn: 'root' }); }
100
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: RootFixtureService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
101
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: RootFixtureService, providedIn: 'root' }); }
102
102
  }
103
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.1", ngImport: i0, type: RootFixtureService, decorators: [{
103
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: RootFixtureService, decorators: [{
104
104
  type: Injectable,
105
105
  args: [{ providedIn: 'root' }]
106
106
  }] });
107
107
  class RootCmp {
108
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.1", ngImport: i0, type: RootCmp, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
109
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0-next.1", type: RootCmp, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "outlet", first: true, predicate: RouterOutlet, descendants: true }], ngImport: i0, template: '<router-outlet></router-outlet>', isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] }); }
108
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: RootCmp, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
109
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0-next.3", type: RootCmp, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "outlet", first: true, predicate: RouterOutlet, descendants: true }], ngImport: i0, template: '<router-outlet></router-outlet>', isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] }); }
110
110
  }
111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.1", ngImport: i0, type: RootCmp, decorators: [{
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.3", ngImport: i0, type: RootCmp, decorators: [{
112
112
  type: Component,
113
113
  args: [{
114
114
  standalone: true,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.0.0-next.1
2
+ * @license Angular v18.0.0-next.3
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 v18.0.0-next.1
2
+ * @license Angular v18.0.0-next.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -690,7 +690,10 @@ export declare class ChildActivationStart {
690
690
  * @publicApi
691
691
  */
692
692
  export declare class ChildrenOutletContexts {
693
+ private parentInjector;
693
694
  private contexts;
695
+ /** @nodoc */
696
+ constructor(parentInjector: EnvironmentInjector);
694
697
  /** Called when a `RouterOutlet` directive is instantiated */
695
698
  onChildOutletCreated(childName: string, outlet: RouterOutletContract): void;
696
699
  /**
@@ -1908,11 +1911,12 @@ export declare type OnSameUrlNavigation = 'reload' | 'ignore';
1908
1911
  * @publicApi
1909
1912
  */
1910
1913
  export declare class OutletContext {
1914
+ injector: EnvironmentInjector;
1911
1915
  outlet: RouterOutletContract | null;
1912
1916
  route: ActivatedRoute | null;
1913
- injector: EnvironmentInjector | null;
1914
1917
  children: ChildrenOutletContexts;
1915
1918
  attachRef: ComponentRef<any> | null;
1919
+ constructor(injector: EnvironmentInjector);
1916
1920
  }
1917
1921
 
1918
1922
  /**
@@ -2048,7 +2052,7 @@ export declare const PRIMARY_OUTLET = "primary";
2048
2052
  export declare function provideRouter(routes: Routes, ...features: RouterFeatures[]): EnvironmentProviders;
2049
2053
 
2050
2054
  /**
2051
- * Registers a [DI provider](guide/glossary#provider) for a set of routes.
2055
+ * Registers a DI provider for a set of routes.
2052
2056
  * @param routes The route configuration to provide.
2053
2057
  *
2054
2058
  * @usageNotes
@@ -2217,6 +2221,11 @@ export declare interface Resolve<T> {
2217
2221
  *
2218
2222
  * Represents the resolved data associated with a particular route.
2219
2223
  *
2224
+ * Returning a `RedirectCommand` directs the router to cancel the current navigation and redirect to
2225
+ * the location provided in the `RedirectCommand`. Note that there are no ordering guarantees when
2226
+ * resolvers execute. If multiple resolvers would return a `RedirectCommand`, only the first one
2227
+ * returned will be used.
2228
+ *
2220
2229
  * @see {@link Route#resolve}
2221
2230
  *
2222
2231
  * @publicApi
@@ -2290,7 +2299,7 @@ export declare class ResolveEnd extends RouterEvent {
2290
2299
  * @publicApi
2291
2300
  * @see {@link Route}
2292
2301
  */
2293
- export declare type ResolveFn<T> = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => MaybeAsync<T>;
2302
+ export declare type ResolveFn<T> = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => MaybeAsync<T | RedirectCommand>;
2294
2303
 
2295
2304
  /**
2296
2305
  * An event triggered at the start of the Resolve phase of routing.
@@ -3026,14 +3035,14 @@ export declare class Router {
3026
3035
  }
3027
3036
 
3028
3037
  /**
3029
- * A [DI token](guide/glossary/#di-token) for the router service.
3038
+ * A DI token for the router service.
3030
3039
  *
3031
3040
  * @publicApi
3032
3041
  */
3033
3042
  export declare const ROUTER_CONFIGURATION: InjectionToken<ExtraOptions>;
3034
3043
 
3035
3044
  /**
3036
- * A [DI token](guide/glossary/#di-token) for the router initializer that
3045
+ * A DI token for the router initializer that
3037
3046
  * is called after the app is bootstrapped.
3038
3047
  *
3039
3048
  * @publicApi
@@ -3733,7 +3742,6 @@ export declare class RouterOutlet implements OnDestroy, OnInit, RouterOutletCont
3733
3742
  private parentContexts;
3734
3743
  private location;
3735
3744
  private changeDetector;
3736
- private environmentInjector;
3737
3745
  private inputBinder;
3738
3746
  /** @nodoc */
3739
3747
  readonly supportsBindingToComponentInputs = true;
@@ -3762,7 +3770,7 @@ export declare class RouterOutlet implements OnDestroy, OnInit, RouterOutletCont
3762
3770
  */
3763
3771
  attach(ref: ComponentRef<any>, activatedRoute: ActivatedRoute): void;
3764
3772
  deactivate(): void;
3765
- activateWith(activatedRoute: ActivatedRoute, environmentInjector?: EnvironmentInjector | null): void;
3773
+ activateWith(activatedRoute: ActivatedRoute, environmentInjector: EnvironmentInjector): void;
3766
3774
  static ɵfac: i0.ɵɵFactoryDeclaration<RouterOutlet, never>;
3767
3775
  static ɵdir: i0.ɵɵDirectiveDeclaration<RouterOutlet, "router-outlet", ["outlet"], { "name": { "alias": "name"; "required": false; }; }, { "activateEvents": "activate"; "deactivateEvents": "deactivate"; "attachEvents": "attach"; "detachEvents": "detach"; }, never, never, true, never>;
3768
3776
  }
@@ -3800,7 +3808,7 @@ export declare interface RouterOutletContract {
3800
3808
  /**
3801
3809
  * Called by the `Router` when the outlet should activate (create a component).
3802
3810
  */
3803
- activateWith(activatedRoute: ActivatedRoute, environmentInjector: EnvironmentInjector | null): void;
3811
+ activateWith(activatedRoute: ActivatedRoute, environmentInjector: EnvironmentInjector): void;
3804
3812
  /**
3805
3813
  * A request to destroy the currently activated component.
3806
3814
  *
@@ -3948,7 +3956,7 @@ export declare class RouterStateSnapshot extends Tree<ActivatedRouteSnapshot> {
3948
3956
  }
3949
3957
 
3950
3958
  /**
3951
- * The [DI token](guide/glossary/#di-token) for a router configuration.
3959
+ * The DI token for a router configuration.
3952
3960
  *
3953
3961
  * `ROUTES` is a low level API for router configuration via dependency injection.
3954
3962
  *
@@ -4645,8 +4653,7 @@ export declare function withHashLocation(): RouterHashLocationFeature;
4645
4653
  export declare function withInMemoryScrolling(options?: InMemoryScrollingOptions): InMemoryScrollingFeature;
4646
4654
 
4647
4655
  /**
4648
- * Subscribes to the Router's navigation events and calls the given function when a
4649
- * `NavigationError` happens.
4656
+ * Provides a function which is called when a navigation error occurs.
4650
4657
  *
4651
4658
  * This function is run inside application's [injection context](guide/dependency-injection-context)
4652
4659
  * so you can use the [`inject`](api/core/inject) function.
@@ -4674,7 +4681,7 @@ export declare function withInMemoryScrolling(options?: InMemoryScrollingOptions
4674
4681
  *
4675
4682
  * @publicApi
4676
4683
  */
4677
- export declare function withNavigationErrorHandler(fn: (error: NavigationError) => void): NavigationErrorHandlerFeature;
4684
+ export declare function withNavigationErrorHandler(handler: (error: NavigationError) => void): NavigationErrorHandlerFeature;
4678
4685
 
4679
4686
  /**
4680
4687
  * Allows to configure a preloading strategy to use. The strategy is configured by providing a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/router",
3
- "version": "18.0.0-next.1",
3
+ "version": "18.0.0-next.3",
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": "18.0.0-next.1",
28
- "@angular/common": "18.0.0-next.1",
29
- "@angular/platform-browser": "18.0.0-next.1",
27
+ "@angular/core": "18.0.0-next.3",
28
+ "@angular/common": "18.0.0-next.3",
29
+ "@angular/platform-browser": "18.0.0-next.3",
30
30
  "rxjs": "^6.5.3 || ^7.4.0"
31
31
  },
32
32
  "ng-update": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.0.0-next.1
2
+ * @license Angular v18.0.0-next.3
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 v18.0.0-next.1
2
+ * @license Angular v18.0.0-next.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */