@angular/router 17.1.0-next.2 → 17.1.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.1.0-next.2
2
+ * @license Angular v17.1.0-next.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -54,16 +54,16 @@ class RouterTestingModule {
54
54
  ]
55
55
  };
56
56
  }
57
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
58
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0-next.2", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] }); }
59
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: RouterTestingModule, providers: [
57
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.3", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
58
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0-next.3", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] }); }
59
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0-next.3", ngImport: i0, type: RouterTestingModule, providers: [
60
60
  ɵROUTER_PROVIDERS,
61
61
  provideLocationMocks(),
62
62
  withPreloading(NoPreloading).ɵproviders,
63
63
  { provide: ROUTES, multi: true, useValue: [] },
64
64
  ], imports: [RouterModule] }); }
65
65
  }
66
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: RouterTestingModule, decorators: [{
66
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.3", ngImport: i0, type: RouterTestingModule, decorators: [{
67
67
  type: NgModule,
68
68
  args: [{
69
69
  exports: [RouterModule],
@@ -92,18 +92,18 @@ class RootFixtureService {
92
92
  this.fixture.detectChanges();
93
93
  return this.fixture;
94
94
  }
95
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: RootFixtureService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
96
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: RootFixtureService, providedIn: 'root' }); }
95
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.3", ngImport: i0, type: RootFixtureService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
96
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0-next.3", ngImport: i0, type: RootFixtureService, providedIn: 'root' }); }
97
97
  }
98
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: RootFixtureService, decorators: [{
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.3", ngImport: i0, type: RootFixtureService, decorators: [{
99
99
  type: Injectable,
100
100
  args: [{ providedIn: 'root' }]
101
101
  }] });
102
102
  class RootCmp {
103
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: RootCmp, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
104
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0-next.2", 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"] }] }); }
103
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.3", ngImport: i0, type: RootCmp, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
104
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.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"] }] }); }
105
105
  }
106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2", ngImport: i0, type: RootCmp, decorators: [{
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.3", ngImport: i0, type: RootCmp, decorators: [{
107
107
  type: Component,
108
108
  args: [{
109
109
  standalone: true,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.1.0-next.2
2
+ * @license Angular v17.1.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 v17.1.0-next.2
2
+ * @license Angular v17.1.0-next.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1045,6 +1045,10 @@ export declare interface ExtraOptions extends InMemoryScrollingOptions, RouterCo
1045
1045
  * If the handler throws an exception, the navigation Promise is rejected with the exception.
1046
1046
  *
1047
1047
  * @deprecated Subscribe to the `Router` events and watch for `NavigationError` instead.
1048
+ * If the ErrorHandler is used to prevent unhandled promise rejections when navigation
1049
+ * errors occur, use the `resolveNavigationPromiseOnError` option instead.
1050
+ *
1051
+ * @see RouterConfigOptions
1048
1052
  */
1049
1053
  errorHandler?: (error: any) => any;
1050
1054
  /**
@@ -1532,6 +1536,31 @@ export declare interface NavigationBehaviorOptions {
1532
1536
  state?: {
1533
1537
  [k: string]: any;
1534
1538
  };
1539
+ /**
1540
+ * Use this to convey transient information about this particular navigation, such as how it
1541
+ * happened. In this way, it's different from the persisted value `state` that will be set to
1542
+ * `history.state`. This object is assigned directly to the Router's current `Navigation`
1543
+ * (it is not copied or cloned), so it should be mutated with caution.
1544
+ *
1545
+ * One example of how this might be used is to trigger different single-page navigation animations
1546
+ * depending on how a certain route was reached. For example, consider a photo gallery app, where
1547
+ * you can reach the same photo URL and state via various routes:
1548
+ *
1549
+ * - Clicking on it in a gallery view
1550
+ * - Clicking
1551
+ * - "next" or "previous" when viewing another photo in the album
1552
+ * - Etc.
1553
+ *
1554
+ * Each of these wants a different animation at navigate time. This information doesn't make sense
1555
+ * to store in the persistent URL or history entry state, but it's still important to communicate
1556
+ * from the rest of the application, into the router.
1557
+ *
1558
+ * This information could be used in coordination with the View Transitions feature and the
1559
+ * `onViewTransitionCreated` callback. The information might be used in the callback to set
1560
+ * classes on the document in order to control the transition animations and remove the classes
1561
+ * when the transition has finished animating.
1562
+ */
1563
+ readonly info?: unknown;
1535
1564
  }
1536
1565
 
1537
1566
  /**
@@ -2900,9 +2929,9 @@ export declare class Router {
2900
2929
  * @param extras An options object that determines how the URL should be constructed or
2901
2930
  * interpreted.
2902
2931
  *
2903
- * @returns A Promise that resolves to `true` when navigation succeeds, to `false` when navigation
2904
- * fails,
2905
- * or is rejected on error.
2932
+ * @returns A Promise that resolves to `true` when navigation succeeds, or `false` when navigation
2933
+ * fails. The Promise is rejected when an error occurs if `resolveNavigationPromiseOnError` is
2934
+ * not `true`.
2906
2935
  *
2907
2936
  * @usageNotes
2908
2937
  *
@@ -3034,6 +3063,14 @@ export declare interface RouterConfigOptions {
3034
3063
  * showing an error message with the URL that failed.
3035
3064
  */
3036
3065
  urlUpdateStrategy?: 'deferred' | 'eager';
3066
+ /**
3067
+ * When `true`, the `Promise` will instead resolve with `false`, as it does with other failed
3068
+ * navigations (for example, when guards are rejected).
3069
+
3070
+ * Otherwise the `Promise` returned by the Router's navigation with be rejected
3071
+ * if an error occurs.
3072
+ */
3073
+ resolveNavigationPromiseOnError?: boolean;
3037
3074
  }
3038
3075
 
3039
3076
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/router",
3
- "version": "17.1.0-next.2",
3
+ "version": "17.1.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": "17.1.0-next.2",
28
- "@angular/common": "17.1.0-next.2",
29
- "@angular/platform-browser": "17.1.0-next.2",
27
+ "@angular/core": "17.1.0-next.3",
28
+ "@angular/common": "17.1.0-next.3",
29
+ "@angular/platform-browser": "17.1.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 v17.1.0-next.2
2
+ * @license Angular v17.1.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 v17.1.0-next.2
2
+ * @license Angular v17.1.0-next.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */