@angular/router 14.0.0-rc.3 → 14.1.0-next.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 v14.0.0-rc.3
2
+ * @license Angular v14.1.0-next.0
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: "14.0.0-rc.3", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
105
- RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0-rc.3", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
106
- RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-rc.3", ngImport: i0, type: RouterTestingModule, providers: [
104
+ RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.0", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
105
+ RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0-next.0", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
106
+ RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-next.0", ngImport: i0, type: RouterTestingModule, providers: [
107
107
  ɵROUTER_PROVIDERS,
108
108
  EXTRA_ROUTER_TESTING_PROVIDERS,
109
109
  { provide: Location, useClass: SpyLocation },
@@ -128,7 +128,7 @@ RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
128
128
  { provide: PreloadingStrategy, useExisting: NoPreloading },
129
129
  provideRoutes([]),
130
130
  ], imports: [RouterModule] });
131
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.3", ngImport: i0, type: RouterTestingModule, decorators: [{
131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.0", ngImport: i0, type: RouterTestingModule, decorators: [{
132
132
  type: NgModule,
133
133
  args: [{
134
134
  exports: [RouterModule],
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-rc.3
2
+ * @license Angular v14.1.0-next.0
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 v14.0.0-rc.3
2
+ * @license Angular v14.1.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -648,6 +648,59 @@ export declare class ChildrenOutletContexts {
648
648
  */
649
649
  export declare function convertToParamMap(params: Params): ParamMap;
650
650
 
651
+ /**
652
+ * Creates a `UrlTree` relative to an `ActivatedRouteSnapshot`.
653
+ *
654
+ * @publicApi
655
+ *
656
+ *
657
+ * @param relativeTo The `ActivatedRouteSnapshot` to apply the commands to
658
+ * @param commands An array of URL fragments with which to construct the new URL tree.
659
+ * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path
660
+ * segments, followed by the parameters for each segment.
661
+ * The fragments are applied to the one provided in the `relativeTo` parameter.
662
+ * @param queryParams The query parameters for the `UrlTree`. `null` if the `UrlTree` does not have
663
+ * any query parameters.
664
+ * @param fragment The fragment for the `UrlTree`. `null` if the `UrlTree` does not have a fragment.
665
+ *
666
+ * @usageNotes
667
+ *
668
+ * ```
669
+ * // create /team/33/user/11
670
+ * createUrlTreeFromSnapshot(snapshot, ['/team', 33, 'user', 11]);
671
+ *
672
+ * // create /team/33;expand=true/user/11
673
+ * createUrlTreeFromSnapshot(snapshot, ['/team', 33, {expand: true}, 'user', 11]);
674
+ *
675
+ * // you can collapse static segments like this (this works only with the first passed-in value):
676
+ * createUrlTreeFromSnapshot(snapshot, ['/team/33/user', userId]);
677
+ *
678
+ * // If the first segment can contain slashes, and you do not want the router to split it,
679
+ * // you can do the following:
680
+ * createUrlTreeFromSnapshot(snapshot, [{segmentPath: '/one/two'}]);
681
+ *
682
+ * // create /team/33/(user/11//right:chat)
683
+ * createUrlTreeFromSnapshot(snapshot, ['/team', 33, {outlets: {primary: 'user/11', right:
684
+ * 'chat'}}], null, null);
685
+ *
686
+ * // remove the right secondary node
687
+ * createUrlTreeFromSnapshot(snapshot, ['/team', 33, {outlets: {primary: 'user/11', right: null}}]);
688
+ *
689
+ * // For the examples below, assume the current URL is for the `/team/33/user/11` and the
690
+ * `ActivatedRouteSnapshot` points to `user/11`:
691
+ *
692
+ * // navigate to /team/33/user/11/details
693
+ * createUrlTreeFromSnapshot(snapshot, ['details']);
694
+ *
695
+ * // navigate to /team/33/user/22
696
+ * createUrlTreeFromSnapshot(snapshot, ['../22']);
697
+ *
698
+ * // navigate to /team/44/user/22
699
+ * createUrlTreeFromSnapshot(snapshot, ['../../team/44/user/22']);
700
+ * ```
701
+ */
702
+ export declare function createUrlTreeFromSnapshot(relativeTo: ActivatedRouteSnapshot, commands: any[], queryParams?: Params | null, fragment?: string | null): UrlTree;
703
+
651
704
  /**
652
705
  *
653
706
  * Represents static data associated with a particular route.
@@ -849,21 +902,22 @@ export declare interface ExtraOptions {
849
902
  * in the following example.
850
903
  *
851
904
  * ```typescript
852
- * class AppModule {
853
- * constructor(router: Router, viewportScroller: ViewportScroller) {
854
- * router.events.pipe(
855
- * filter((e: Event): e is Scroll => e instanceof Scroll)
905
+ * class AppComponent {
906
+ * movieData: any;
907
+ *
908
+ * constructor(private router: Router, private viewportScroller: ViewportScroller,
909
+ * changeDetectorRef: ChangeDetectorRef) {
910
+ * router.events.pipe(filter((event: Event): event is Scroll => event instanceof Scroll)
856
911
  * ).subscribe(e => {
857
- * if (e.position) {
858
- * // backward navigation
859
- * viewportScroller.scrollToPosition(e.position);
860
- * } else if (e.anchor) {
861
- * // anchor navigation
862
- * viewportScroller.scrollToAnchor(e.anchor);
863
- * } else {
864
- * // forward navigation
865
- * viewportScroller.scrollToPosition([0, 0]);
866
- * }
912
+ * fetch('http://example.com/movies.json').then(response => {
913
+ * this.movieData = response.json();
914
+ * // update the template with the data before restoring scroll
915
+ * changeDetectorRef.detectChanges();
916
+ *
917
+ * if (e.position) {
918
+ * viewportScroller.scrollToPosition(e.position);
919
+ * }
920
+ * });
867
921
  * });
868
922
  * }
869
923
  * }
@@ -1584,8 +1638,9 @@ export declare function provideRoutes(routes: Routes): any;
1584
1638
  *
1585
1639
  * How to handle query parameters in a router link.
1586
1640
  * One of:
1587
- * - `merge` : Merge new with current parameters.
1588
- * - `preserve` : Preserve current parameters.
1641
+ * - `"merge"` : Merge new parameters with current parameters.
1642
+ * - `"preserve"` : Preserve current parameters.
1643
+ * - `""` : Replace current parameters with new parameters. This is the default behavior.
1589
1644
  *
1590
1645
  * @see `UrlCreationOptions#queryParamsHandling`
1591
1646
  * @see `RouterLink`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/router",
3
- "version": "14.0.0-rc.3",
3
+ "version": "14.1.0-next.0",
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": "14.0.0-rc.3",
28
- "@angular/common": "14.0.0-rc.3",
29
- "@angular/platform-browser": "14.0.0-rc.3",
27
+ "@angular/core": "14.1.0-next.0",
28
+ "@angular/common": "14.1.0-next.0",
29
+ "@angular/platform-browser": "14.1.0-next.0",
30
30
  "rxjs": "^6.5.3 || ^7.4.0"
31
31
  },
32
32
  "ng-update": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-rc.3
2
+ * @license Angular v14.1.0-next.0
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 v14.0.0-rc.3
2
+ * @license Angular v14.1.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */