@angular/router 13.0.0-next.7 → 13.0.0-rc.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.
- package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/esm2020/router.mjs +5 -0
- package/{esm2015/src/apply_redirects.js → esm2020/src/apply_redirects.mjs} +0 -0
- package/esm2020/src/components/empty_outlet.mjs +29 -0
- package/esm2020/src/config.mjs +14 -0
- package/{esm2015/src/create_router_state.js → esm2020/src/create_router_state.mjs} +0 -0
- package/{esm2015/src/create_url_tree.js → esm2020/src/create_url_tree.mjs} +0 -0
- package/esm2020/src/directives/router_link.mjs +353 -0
- package/esm2020/src/directives/router_link_active.mjs +215 -0
- package/esm2020/src/directives/router_outlet.mjs +219 -0
- package/{esm2015/src/events.js → esm2020/src/events.mjs} +1 -1
- package/{esm2015/src/index.js → esm2020/src/index.mjs} +1 -1
- package/{esm2015/src/interfaces.js → esm2020/src/interfaces.mjs} +1 -1
- package/{esm2015/src/operators/activate_routes.js → esm2020/src/operators/activate_routes.mjs} +0 -0
- package/esm2020/src/operators/apply_redirects.mjs +14 -0
- package/esm2020/src/operators/check_guards.mjs +138 -0
- package/{esm2015/src/operators/prioritized_guard_value.js → esm2020/src/operators/prioritized_guard_value.mjs} +0 -0
- package/esm2020/src/operators/recognize.mjs +14 -0
- package/esm2020/src/operators/resolve_data.mjs +59 -0
- package/{esm2015/src/operators/switch_tap.js → esm2020/src/operators/switch_tap.mjs} +0 -0
- package/{esm2015/src/private_export.js → esm2020/src/private_export.mjs} +0 -0
- package/esm2020/src/recognize.mjs +262 -0
- package/{esm2015/src/route_reuse_strategy.js → esm2020/src/route_reuse_strategy.mjs} +0 -0
- package/esm2020/src/router.mjs +1002 -0
- package/esm2020/src/router_config_loader.mjs +71 -0
- package/esm2020/src/router_module.mjs +370 -0
- package/esm2020/src/router_outlet_context.mjs +74 -0
- package/esm2020/src/router_preloader.mjs +127 -0
- package/esm2020/src/router_scroller.mjs +95 -0
- package/esm2020/src/router_state.mjs +404 -0
- package/{esm2015/src/shared.js → esm2020/src/shared.mjs} +0 -0
- package/{esm2015/src/url_handling_strategy.js → esm2020/src/url_handling_strategy.mjs} +0 -0
- package/{esm2015/src/url_tree.js → esm2020/src/url_tree.mjs} +0 -0
- package/{esm2015/src/utils/collection.js → esm2020/src/utils/collection.mjs} +0 -0
- package/{esm2015/src/utils/config.js → esm2020/src/utils/config.mjs} +2 -2
- package/esm2020/src/utils/config_matching.mjs +145 -0
- package/{esm2015/src/utils/preactivation.js → esm2020/src/utils/preactivation.mjs} +0 -0
- package/{esm2015/src/utils/tree.js → esm2020/src/utils/tree.mjs} +0 -0
- package/{esm2015/src/utils/type_guards.js → esm2020/src/utils/type_guards.mjs} +0 -0
- package/{esm2015/src/version.js → esm2020/src/version.mjs} +1 -1
- package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
- package/{esm2015/testing/public_api.js → esm2020/testing/public_api.mjs} +0 -0
- package/esm2020/testing/src/extra_router_testing_providers.mjs +10 -0
- package/esm2020/testing/src/router_testing_module.mjs +122 -0
- package/esm2020/testing/src/spy_ng_module_factory_loader.mjs +10 -0
- package/esm2020/testing/src/testing.mjs +15 -0
- package/{esm2015/testing/testing.js → esm2020/testing/testing.mjs} +0 -0
- package/{esm2015/upgrade/index.js → esm2020/upgrade/index.mjs} +0 -0
- package/{esm2015/upgrade/public_api.js → esm2020/upgrade/public_api.mjs} +0 -0
- package/esm2020/upgrade/src/upgrade.mjs +120 -0
- package/{esm2015/upgrade/upgrade.js → esm2020/upgrade/upgrade.mjs} +0 -0
- package/fesm2015/{router.js → router.mjs} +532 -517
- package/fesm2015/router.mjs.map +1 -0
- package/fesm2015/testing.mjs +179 -0
- package/fesm2015/testing.mjs.map +1 -0
- package/fesm2015/{upgrade.js → upgrade.mjs} +4 -5
- package/fesm2015/upgrade.mjs.map +1 -0
- package/fesm2020/router.mjs +6159 -0
- package/fesm2020/router.mjs.map +1 -0
- package/fesm2020/testing.mjs +179 -0
- package/fesm2020/testing.mjs.map +1 -0
- package/fesm2020/upgrade.mjs +150 -0
- package/fesm2020/upgrade.mjs.map +1 -0
- package/package.json +42 -12
- package/router.d.ts +118 -118
- package/testing/package.json +5 -5
- package/testing/testing.d.ts +9 -66
- package/upgrade/package.json +5 -5
- package/upgrade/upgrade.d.ts +1 -1
- package/bundles/router-testing.umd.js +0 -541
- package/bundles/router-testing.umd.js.map +0 -1
- package/bundles/router-upgrade.umd.js +0 -157
- package/bundles/router-upgrade.umd.js.map +0 -1
- package/bundles/router.umd.js +0 -6867
- package/bundles/router.umd.js.map +0 -1
- package/esm2015/router.externs.js +0 -6
- package/esm2015/router.js +0 -9
- package/esm2015/src/components/empty_outlet.js +0 -24
- package/esm2015/src/config.js +0 -14
- package/esm2015/src/directives/router_link.js +0 -328
- package/esm2015/src/directives/router_link_active.js +0 -210
- package/esm2015/src/directives/router_outlet.js +0 -193
- package/esm2015/src/operators/apply_redirects.js +0 -14
- package/esm2015/src/operators/check_guards.js +0 -138
- package/esm2015/src/operators/recognize.js +0 -14
- package/esm2015/src/operators/resolve_data.js +0 -56
- package/esm2015/src/recognize.js +0 -262
- package/esm2015/src/router.js +0 -1012
- package/esm2015/src/router_config_loader.js +0 -76
- package/esm2015/src/router_module.js +0 -363
- package/esm2015/src/router_outlet_context.js +0 -73
- package/esm2015/src/router_preloader.js +0 -130
- package/esm2015/src/router_scroller.js +0 -95
- package/esm2015/src/router_state.js +0 -404
- package/esm2015/src/utils/config_matching.js +0 -145
- package/esm2015/testing/src/router_testing_module.js +0 -166
- package/esm2015/testing/src/testing.js +0 -14
- package/esm2015/testing/testing.externs.js +0 -6
- package/esm2015/upgrade/src/upgrade.js +0 -122
- package/esm2015/upgrade/upgrade.externs.js +0 -6
- package/fesm2015/router.js.map +0 -1
- package/fesm2015/testing.js +0 -204
- package/fesm2015/testing.js.map +0 -1
- package/fesm2015/upgrade.js.map +0 -1
- package/router.metadata.json +0 -1
- package/testing/testing.metadata.json +0 -1
- package/testing.d.ts +0 -7
- package/testing.metadata.json +0 -1
- package/upgrade/upgrade.metadata.json +0 -1
- package/upgrade.d.ts +0 -7
- package/upgrade.metadata.json +0 -1
package/router.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v13.0.0-
|
|
2
|
+
* @license Angular v13.0.0-rc.1
|
|
3
3
|
* (c) 2010-2021 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -11,21 +11,17 @@ import { ComponentFactoryResolver } from '@angular/core';
|
|
|
11
11
|
import { ComponentRef } from '@angular/core';
|
|
12
12
|
import { ElementRef } from '@angular/core';
|
|
13
13
|
import { EventEmitter } from '@angular/core';
|
|
14
|
-
import
|
|
14
|
+
import * as i0 from '@angular/core';
|
|
15
15
|
import { InjectionToken } from '@angular/core';
|
|
16
16
|
import { Injector } from '@angular/core';
|
|
17
17
|
import { Location as Location_2 } from '@angular/common';
|
|
18
18
|
import { LocationStrategy } from '@angular/common';
|
|
19
19
|
import { ModuleWithProviders } from '@angular/core';
|
|
20
20
|
import { NgModuleFactory } from '@angular/core';
|
|
21
|
-
import { NgModuleFactoryLoader } from '@angular/core';
|
|
22
|
-
import { NgProbeToken } from '@angular/core';
|
|
23
21
|
import { Observable } from 'rxjs';
|
|
24
22
|
import { OnChanges } from '@angular/core';
|
|
25
23
|
import { OnDestroy } from '@angular/core';
|
|
26
24
|
import { OnInit } from '@angular/core';
|
|
27
|
-
import { PathLocationStrategy } from '@angular/common';
|
|
28
|
-
import { PlatformLocation } from '@angular/common';
|
|
29
25
|
import { Provider } from '@angular/core';
|
|
30
26
|
import { QueryList } from '@angular/core';
|
|
31
27
|
import { Renderer2 } from '@angular/core';
|
|
@@ -33,7 +29,6 @@ import { SimpleChanges } from '@angular/core';
|
|
|
33
29
|
import { Type } from '@angular/core';
|
|
34
30
|
import { Version } from '@angular/core';
|
|
35
31
|
import { ViewContainerRef } from '@angular/core';
|
|
36
|
-
import { ViewportScroller } from '@angular/common';
|
|
37
32
|
|
|
38
33
|
/**
|
|
39
34
|
* Provides access to information about a route associated with a component
|
|
@@ -538,7 +533,7 @@ export declare interface CanDeactivate<T> {
|
|
|
538
533
|
* {
|
|
539
534
|
* path: 'team/:id',
|
|
540
535
|
* component: TeamComponent,
|
|
541
|
-
* loadChildren: 'team.
|
|
536
|
+
* loadChildren: () => import('./team').then(mod => mod.TeamModule),
|
|
542
537
|
* canLoad: [CanLoadTeamSection]
|
|
543
538
|
* }
|
|
544
539
|
* ])
|
|
@@ -557,7 +552,7 @@ export declare interface CanDeactivate<T> {
|
|
|
557
552
|
* {
|
|
558
553
|
* path: 'team/:id',
|
|
559
554
|
* component: TeamComponent,
|
|
560
|
-
* loadChildren: 'team.
|
|
555
|
+
* loadChildren: () => import('./team').then(mod => mod.TeamModule),
|
|
561
556
|
* canLoad: ['canLoadTeamSection']
|
|
562
557
|
* }
|
|
563
558
|
* ])
|
|
@@ -682,18 +677,6 @@ export declare class DefaultUrlSerializer implements UrlSerializer {
|
|
|
682
677
|
serialize(tree: UrlTree): string;
|
|
683
678
|
}
|
|
684
679
|
|
|
685
|
-
/**
|
|
686
|
-
* A string of the form `path/to/file#exportName` that acts as a URL for a set of routes to load.
|
|
687
|
-
*
|
|
688
|
-
* @see `loadChildrenCallback`
|
|
689
|
-
* @publicApi
|
|
690
|
-
* @deprecated The `string` form of `loadChildren` is deprecated in favor of the
|
|
691
|
-
* `LoadChildrenCallback` function which uses the ES dynamic `import()` expression.
|
|
692
|
-
* This offers a more natural and standards-based mechanism to dynamically
|
|
693
|
-
* load an ES module at runtime.
|
|
694
|
-
*/
|
|
695
|
-
export declare type DeprecatedLoadChildren = string;
|
|
696
|
-
|
|
697
680
|
/**
|
|
698
681
|
* @description
|
|
699
682
|
*
|
|
@@ -738,7 +721,7 @@ declare type ErrorHandler = (error: any) => any;
|
|
|
738
721
|
* * [ResolveStart](api/router/ResolveStart): When the router begins the *resolve*
|
|
739
722
|
* phase of routing.
|
|
740
723
|
* * [ResolveEnd](api/router/ResolveEnd): When the router finishes the *resolve*
|
|
741
|
-
* phase of routing
|
|
724
|
+
* phase of routing successfully.
|
|
742
725
|
* * [ChildActivationEnd](api/router/ChildActivationEnd): When the router finishes
|
|
743
726
|
* activating a route's children.
|
|
744
727
|
* * [ActivationEnd](api/router/ActivationEnd): When the router finishes activating a route.
|
|
@@ -923,6 +906,28 @@ export declare interface ExtraOptions {
|
|
|
923
906
|
* The default in v11 is `corrected`.
|
|
924
907
|
*/
|
|
925
908
|
relativeLinkResolution?: 'legacy' | 'corrected';
|
|
909
|
+
/**
|
|
910
|
+
* Configures how the Router attempts to restore state when a navigation is cancelled.
|
|
911
|
+
*
|
|
912
|
+
* 'replace' - Always uses `location.replaceState` to set the browser state to the state of the
|
|
913
|
+
* router before the navigation started. This means that if the URL of the browser is updated
|
|
914
|
+
* _before_ the navigation is canceled, the Router will simply replace the item in history rather
|
|
915
|
+
* than trying to restore to the previous location in the session history. This happens most
|
|
916
|
+
* frequently with `urlUpdateStrategy: 'eager'` and navigations with the browser back/forward
|
|
917
|
+
* buttons.
|
|
918
|
+
*
|
|
919
|
+
* 'computed' - Will attempt to return to the same index in the session history that corresponds
|
|
920
|
+
* to the Angular route when the navigation gets cancelled. For example, if the browser back
|
|
921
|
+
* button is clicked and the navigation is cancelled, the Router will trigger a forward navigation
|
|
922
|
+
* and vice versa.
|
|
923
|
+
*
|
|
924
|
+
* Note: the 'computed' option is incompatible with any `UrlHandlingStrategy` which only
|
|
925
|
+
* handles a portion of the URL because the history restoration navigates to the previous place in
|
|
926
|
+
* the browser history rather than simply resetting a portion of the URL.
|
|
927
|
+
*
|
|
928
|
+
* The default value is `replace` when not set.
|
|
929
|
+
*/
|
|
930
|
+
canceledNavigationResolution?: 'replace' | 'computed';
|
|
926
931
|
}
|
|
927
932
|
|
|
928
933
|
/**
|
|
@@ -977,6 +982,33 @@ export declare class GuardsCheckStart extends RouterEvent {
|
|
|
977
982
|
toString(): string;
|
|
978
983
|
}
|
|
979
984
|
|
|
985
|
+
declare namespace i1 {
|
|
986
|
+
export {
|
|
987
|
+
RouterOutletContract,
|
|
988
|
+
RouterOutlet
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
declare namespace i2 {
|
|
993
|
+
export {
|
|
994
|
+
RouterLink,
|
|
995
|
+
RouterLinkWithHref
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
declare namespace i3 {
|
|
1000
|
+
export {
|
|
1001
|
+
RouterLinkActive
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
declare namespace i4 {
|
|
1006
|
+
export {
|
|
1007
|
+
ɵEmptyOutletComponent,
|
|
1008
|
+
ɵEmptyOutletComponent as EmptyOutletComponent
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
|
|
980
1012
|
/**
|
|
981
1013
|
* Allowed values in an `ExtraOptions` object that configure
|
|
982
1014
|
* when the router performs the initial navigation operation.
|
|
@@ -1055,13 +1087,10 @@ export declare interface IsActiveMatchOptions {
|
|
|
1055
1087
|
*
|
|
1056
1088
|
* A function that returns a set of routes to load.
|
|
1057
1089
|
*
|
|
1058
|
-
*
|
|
1059
|
-
* form (`LoadChildrenCallback`) should be used instead.
|
|
1060
|
-
*
|
|
1061
|
-
* @see `loadChildrenCallback`
|
|
1090
|
+
* @see `LoadChildrenCallback`
|
|
1062
1091
|
* @publicApi
|
|
1063
1092
|
*/
|
|
1064
|
-
export declare type LoadChildren = LoadChildrenCallback
|
|
1093
|
+
export declare type LoadChildren = LoadChildrenCallback;
|
|
1065
1094
|
|
|
1066
1095
|
/**
|
|
1067
1096
|
*
|
|
@@ -2187,7 +2216,7 @@ export declare class Router {
|
|
|
2187
2216
|
/**
|
|
2188
2217
|
* Creates the router service.
|
|
2189
2218
|
*/
|
|
2190
|
-
constructor(rootComponentType: Type<any> | null, urlSerializer: UrlSerializer, rootContexts: ChildrenOutletContexts, location: Location_2, injector: Injector,
|
|
2219
|
+
constructor(rootComponentType: Type<any> | null, urlSerializer: UrlSerializer, rootContexts: ChildrenOutletContexts, location: Location_2, injector: Injector, compiler: Compiler, config: Routes);
|
|
2191
2220
|
private setupNavigations;
|
|
2192
2221
|
private setTransition;
|
|
2193
2222
|
/**
|
|
@@ -2366,6 +2395,8 @@ export declare class Router {
|
|
|
2366
2395
|
private resetUrlToCurrentUrlTree;
|
|
2367
2396
|
private cancelNavigationTransition;
|
|
2368
2397
|
private generateNgRouterState;
|
|
2398
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Router, never>;
|
|
2399
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<Router>;
|
|
2369
2400
|
}
|
|
2370
2401
|
|
|
2371
2402
|
/**
|
|
@@ -2627,6 +2658,8 @@ export declare class RouterLink implements OnChanges {
|
|
|
2627
2658
|
/** @nodoc */
|
|
2628
2659
|
onClick(): boolean;
|
|
2629
2660
|
get urlTree(): UrlTree | null;
|
|
2661
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouterLink, [null, null, { attribute: "tabindex"; }, null, null]>;
|
|
2662
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLink, ":not(a):not(area)[routerLink]", never, { "queryParams": "queryParams"; "fragment": "fragment"; "queryParamsHandling": "queryParamsHandling"; "preserveFragment": "preserveFragment"; "skipLocationChange": "skipLocationChange"; "replaceUrl": "replaceUrl"; "state": "state"; "relativeTo": "relativeTo"; "routerLink": "routerLink"; }, {}, never>;
|
|
2630
2663
|
}
|
|
2631
2664
|
|
|
2632
2665
|
/**
|
|
@@ -2740,6 +2773,8 @@ export declare class RouterLinkActive implements OnChanges, OnDestroy, AfterCont
|
|
|
2740
2773
|
private update;
|
|
2741
2774
|
private isLinkActive;
|
|
2742
2775
|
private hasActiveLinks;
|
|
2776
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouterLinkActive, [null, null, null, null, { optional: true; }, { optional: true; }]>;
|
|
2777
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLinkActive, "[routerLinkActive]", ["routerLinkActive"], { "routerLinkActiveOptions": "routerLinkActiveOptions"; "routerLinkActive": "routerLinkActive"; }, { "isActiveChange": "isActiveChange"; }, ["links", "linksWithHrefs"]>;
|
|
2743
2778
|
}
|
|
2744
2779
|
|
|
2745
2780
|
/**
|
|
@@ -2839,6 +2874,8 @@ export declare class RouterLinkWithHref implements OnChanges, OnDestroy {
|
|
|
2839
2874
|
onClick(button: number, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
|
|
2840
2875
|
private updateTargetUrlAndHref;
|
|
2841
2876
|
get urlTree(): UrlTree | null;
|
|
2877
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouterLinkWithHref, never>;
|
|
2878
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLinkWithHref, "a[routerLink],area[routerLink]", never, { "target": "target"; "queryParams": "queryParams"; "fragment": "fragment"; "queryParamsHandling": "queryParamsHandling"; "preserveFragment": "preserveFragment"; "skipLocationChange": "skipLocationChange"; "replaceUrl": "replaceUrl"; "state": "state"; "relativeTo": "relativeTo"; "routerLink": "routerLink"; }, {}, never>;
|
|
2842
2879
|
}
|
|
2843
2880
|
|
|
2844
2881
|
/**
|
|
@@ -2900,6 +2937,9 @@ export declare class RouterModule {
|
|
|
2900
2937
|
*
|
|
2901
2938
|
*/
|
|
2902
2939
|
static forChild(routes: Routes): ModuleWithProviders<RouterModule>;
|
|
2940
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouterModule, [{ optional: true; }, { optional: true; }]>;
|
|
2941
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<RouterModule, [typeof i1.RouterOutlet, typeof i2.RouterLink, typeof i2.RouterLinkWithHref, typeof i3.RouterLinkActive, typeof i4.ɵEmptyOutletComponent], never, [typeof i1.RouterOutlet, typeof i2.RouterLink, typeof i2.RouterLinkWithHref, typeof i3.RouterLinkActive, typeof i4.ɵEmptyOutletComponent]>;
|
|
2942
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<RouterModule>;
|
|
2903
2943
|
}
|
|
2904
2944
|
|
|
2905
2945
|
/**
|
|
@@ -2932,12 +2972,17 @@ export declare class RouterModule {
|
|
|
2932
2972
|
* `http://base-path/primary-route-path(outlet-name:route-path)`
|
|
2933
2973
|
*
|
|
2934
2974
|
* A router outlet emits an activate event when a new component is instantiated,
|
|
2935
|
-
*
|
|
2975
|
+
* deactivate event when a component is destroyed.
|
|
2976
|
+
* An attached event emits when the `RouteReuseStrategy` instructs the outlet to reattach the
|
|
2977
|
+
* subtree, and the detached event emits when the `RouteReuseStrategy` instructs the outlet to
|
|
2978
|
+
* detach the subtree.
|
|
2936
2979
|
*
|
|
2937
2980
|
* ```
|
|
2938
2981
|
* <router-outlet
|
|
2939
2982
|
* (activate)='onActivate($event)'
|
|
2940
|
-
* (deactivate)='onDeactivate($event)'
|
|
2983
|
+
* (deactivate)='onDeactivate($event)'
|
|
2984
|
+
* (attach)='onAttach($event)'
|
|
2985
|
+
* (detach)='onDetach($event)'></router-outlet>
|
|
2941
2986
|
* ```
|
|
2942
2987
|
*
|
|
2943
2988
|
* @see [Routing tutorial](guide/router-tutorial-toh#named-outlets "Example of a named
|
|
@@ -2958,6 +3003,16 @@ export declare class RouterOutlet implements OnDestroy, OnInit, RouterOutletCont
|
|
|
2958
3003
|
private name;
|
|
2959
3004
|
activateEvents: EventEmitter<any>;
|
|
2960
3005
|
deactivateEvents: EventEmitter<any>;
|
|
3006
|
+
/**
|
|
3007
|
+
* Emits an attached component instance when the `RouteReuseStrategy` instructs to re-attach a
|
|
3008
|
+
* previously detached subtree.
|
|
3009
|
+
**/
|
|
3010
|
+
attachEvents: EventEmitter<unknown>;
|
|
3011
|
+
/**
|
|
3012
|
+
* Emits a detached component instance when the `RouteReuseStrategy` instructs to detach the
|
|
3013
|
+
* subtree.
|
|
3014
|
+
*/
|
|
3015
|
+
detachEvents: EventEmitter<unknown>;
|
|
2961
3016
|
constructor(parentContexts: ChildrenOutletContexts, location: ViewContainerRef, resolver: ComponentFactoryResolver, name: string, changeDetector: ChangeDetectorRef);
|
|
2962
3017
|
/** @nodoc */
|
|
2963
3018
|
ngOnDestroy(): void;
|
|
@@ -2981,6 +3036,8 @@ export declare class RouterOutlet implements OnDestroy, OnInit, RouterOutletCont
|
|
|
2981
3036
|
attach(ref: ComponentRef<any>, activatedRoute: ActivatedRoute): void;
|
|
2982
3037
|
deactivate(): void;
|
|
2983
3038
|
activateWith(activatedRoute: ActivatedRoute, resolver: ComponentFactoryResolver | null): void;
|
|
3039
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouterOutlet, [null, null, null, { attribute: "name"; }, null]>;
|
|
3040
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RouterOutlet, "router-outlet", ["outlet"], {}, { "activateEvents": "activate"; "deactivateEvents": "deactivate"; "attachEvents": "attach"; "detachEvents": "detach"; }, never>;
|
|
2984
3041
|
}
|
|
2985
3042
|
|
|
2986
3043
|
/**
|
|
@@ -3043,6 +3100,16 @@ export declare interface RouterOutletContract {
|
|
|
3043
3100
|
* Emits a deactivate event when a component is destroyed.
|
|
3044
3101
|
*/
|
|
3045
3102
|
deactivateEvents?: EventEmitter<unknown>;
|
|
3103
|
+
/**
|
|
3104
|
+
* Emits an attached component instance when the `RouteReuseStrategy` instructs to re-attach a
|
|
3105
|
+
* previously detached subtree.
|
|
3106
|
+
**/
|
|
3107
|
+
attachEvents?: EventEmitter<unknown>;
|
|
3108
|
+
/**
|
|
3109
|
+
* Emits a detached component instance when the `RouteReuseStrategy` instructs to detach the
|
|
3110
|
+
* subtree.
|
|
3111
|
+
*/
|
|
3112
|
+
detachEvents?: EventEmitter<unknown>;
|
|
3046
3113
|
}
|
|
3047
3114
|
|
|
3048
3115
|
/**
|
|
@@ -3063,13 +3130,15 @@ export declare class RouterPreloader implements OnDestroy {
|
|
|
3063
3130
|
private preloadingStrategy;
|
|
3064
3131
|
private loader;
|
|
3065
3132
|
private subscription?;
|
|
3066
|
-
constructor(router: Router,
|
|
3133
|
+
constructor(router: Router, compiler: Compiler, injector: Injector, preloadingStrategy: PreloadingStrategy);
|
|
3067
3134
|
setUpPreloading(): void;
|
|
3068
3135
|
preload(): Observable<any>;
|
|
3069
3136
|
/** @nodoc */
|
|
3070
3137
|
ngOnDestroy(): void;
|
|
3071
3138
|
private processRoutes;
|
|
3072
3139
|
private preloadConfig;
|
|
3140
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouterPreloader, never>;
|
|
3141
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RouterPreloader>;
|
|
3073
3142
|
}
|
|
3074
3143
|
|
|
3075
3144
|
/**
|
|
@@ -3103,7 +3172,7 @@ export declare class RouterPreloader implements OnDestroy {
|
|
|
3103
3172
|
*
|
|
3104
3173
|
* @publicApi
|
|
3105
3174
|
*/
|
|
3106
|
-
export declare class RouterState extends
|
|
3175
|
+
export declare class RouterState extends Tree<ActivatedRoute> {
|
|
3107
3176
|
/** The current snapshot of the router state */
|
|
3108
3177
|
snapshot: RouterStateSnapshot;
|
|
3109
3178
|
toString(): string;
|
|
@@ -3136,7 +3205,7 @@ export declare class RouterState extends ɵangular_packages_router_router_m<Acti
|
|
|
3136
3205
|
*
|
|
3137
3206
|
* @publicApi
|
|
3138
3207
|
*/
|
|
3139
|
-
export declare class RouterStateSnapshot extends
|
|
3208
|
+
export declare class RouterStateSnapshot extends Tree<ActivatedRouteSnapshot> {
|
|
3140
3209
|
/** The url from which this snapshot was created */
|
|
3141
3210
|
url: string;
|
|
3142
3211
|
toString(): string;
|
|
@@ -3220,6 +3289,19 @@ export declare class Scroll {
|
|
|
3220
3289
|
toString(): string;
|
|
3221
3290
|
}
|
|
3222
3291
|
|
|
3292
|
+
|
|
3293
|
+
declare class Tree<T> {
|
|
3294
|
+
constructor(root: TreeNode<T>);
|
|
3295
|
+
get root(): T;
|
|
3296
|
+
}
|
|
3297
|
+
|
|
3298
|
+
declare class TreeNode<T> {
|
|
3299
|
+
value: T;
|
|
3300
|
+
children: TreeNode<T>[];
|
|
3301
|
+
constructor(value: T, children: TreeNode<T>[]);
|
|
3302
|
+
toString(): string;
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3223
3305
|
/**
|
|
3224
3306
|
* @description
|
|
3225
3307
|
*
|
|
@@ -3536,90 +3618,8 @@ export declare class UrlTree {
|
|
|
3536
3618
|
*/
|
|
3537
3619
|
export declare const VERSION: Version;
|
|
3538
3620
|
|
|
3539
|
-
/**
|
|
3540
|
-
* @docsNotRequired
|
|
3541
|
-
*/
|
|
3542
|
-
export declare const ɵangular_packages_router_router_a: InjectionToken<void>;
|
|
3543
|
-
|
|
3544
|
-
export declare function ɵangular_packages_router_router_b(): NgProbeToken;
|
|
3545
|
-
|
|
3546
|
-
export declare function ɵangular_packages_router_router_c(router: Router, viewportScroller: ViewportScroller, config: ExtraOptions): ɵangular_packages_router_router_o;
|
|
3547
|
-
|
|
3548
|
-
export declare function ɵangular_packages_router_router_d(platformLocationStrategy: PlatformLocation, baseHref: string, options?: ExtraOptions): HashLocationStrategy | PathLocationStrategy;
|
|
3549
|
-
|
|
3550
|
-
export declare function ɵangular_packages_router_router_e(router: Router): any;
|
|
3551
|
-
|
|
3552
|
-
export declare function ɵangular_packages_router_router_f(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2, injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler, config: Route[][], opts?: ExtraOptions, urlHandlingStrategy?: UrlHandlingStrategy, routeReuseStrategy?: RouteReuseStrategy): Router;
|
|
3553
|
-
|
|
3554
|
-
export declare function ɵangular_packages_router_router_g(router: Router): ActivatedRoute;
|
|
3555
|
-
|
|
3556
|
-
/**
|
|
3557
|
-
* Router initialization requires two steps:
|
|
3558
|
-
*
|
|
3559
|
-
* First, we start the navigation in a `APP_INITIALIZER` to block the bootstrap if
|
|
3560
|
-
* a resolver or a guard executes asynchronously.
|
|
3561
|
-
*
|
|
3562
|
-
* Next, we actually run activation in a `BOOTSTRAP_LISTENER`, using the
|
|
3563
|
-
* `afterPreactivation` hook provided by the router.
|
|
3564
|
-
* The router navigation starts, reaches the point when preactivation is done, and then
|
|
3565
|
-
* pauses. It waits for the hook to be resolved. We then resolve it only in a bootstrap listener.
|
|
3566
|
-
*/
|
|
3567
|
-
export declare class ɵangular_packages_router_router_h implements OnDestroy {
|
|
3568
|
-
private injector;
|
|
3569
|
-
private initNavigation;
|
|
3570
|
-
private destroyed;
|
|
3571
|
-
private resultOfPreactivationDone;
|
|
3572
|
-
constructor(injector: Injector);
|
|
3573
|
-
appInitializer(): Promise<any>;
|
|
3574
|
-
bootstrapListener(bootstrappedComponentRef: ComponentRef<any>): void;
|
|
3575
|
-
ngOnDestroy(): void;
|
|
3576
|
-
}
|
|
3577
|
-
|
|
3578
|
-
export declare function ɵangular_packages_router_router_i(r: ɵangular_packages_router_router_h): () => Promise<any>;
|
|
3579
|
-
|
|
3580
|
-
export declare function ɵangular_packages_router_router_j(r: ɵangular_packages_router_router_h): (bootstrappedComponentRef: ComponentRef<any>) => void;
|
|
3581
|
-
|
|
3582
|
-
export declare function ɵangular_packages_router_router_k(): ReadonlyArray<Provider>;
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
export declare class ɵangular_packages_router_router_m<T> {
|
|
3586
|
-
constructor(root: ɵangular_packages_router_router_n<T>);
|
|
3587
|
-
get root(): T;
|
|
3588
|
-
}
|
|
3589
|
-
|
|
3590
|
-
export declare class ɵangular_packages_router_router_n<T> {
|
|
3591
|
-
value: T;
|
|
3592
|
-
children: ɵangular_packages_router_router_n<T>[];
|
|
3593
|
-
constructor(value: T, children: ɵangular_packages_router_router_n<T>[]);
|
|
3594
|
-
toString(): string;
|
|
3595
|
-
}
|
|
3596
|
-
|
|
3597
|
-
export declare class ɵangular_packages_router_router_o implements OnDestroy {
|
|
3598
|
-
private router;
|
|
3599
|
-
/** @docsNotRequired */ readonly viewportScroller: ViewportScroller;
|
|
3600
|
-
private options;
|
|
3601
|
-
private routerEventsSubscription;
|
|
3602
|
-
private scrollEventsSubscription;
|
|
3603
|
-
private lastId;
|
|
3604
|
-
private lastSource;
|
|
3605
|
-
private restoredId;
|
|
3606
|
-
private store;
|
|
3607
|
-
constructor(router: Router,
|
|
3608
|
-
/** @docsNotRequired */ viewportScroller: ViewportScroller, options?: {
|
|
3609
|
-
scrollPositionRestoration?: 'disabled' | 'enabled' | 'top';
|
|
3610
|
-
anchorScrolling?: 'disabled' | 'enabled';
|
|
3611
|
-
});
|
|
3612
|
-
init(): void;
|
|
3613
|
-
private createScrollEvents;
|
|
3614
|
-
private consumeScrollEvents;
|
|
3615
|
-
private scheduleScrollEvent;
|
|
3616
|
-
/** @nodoc */
|
|
3617
|
-
ngOnDestroy(): void;
|
|
3618
|
-
}
|
|
3619
|
-
|
|
3620
3621
|
export declare function ɵassignExtraOptionsToRouter(opts: ExtraOptions, router: Router): void;
|
|
3621
3622
|
|
|
3622
|
-
|
|
3623
3623
|
/**
|
|
3624
3624
|
* This component is used internally within the router to be a placeholder when an empty
|
|
3625
3625
|
* router-outlet is needed. For example, with a config such as:
|
|
@@ -3629,10 +3629,10 @@ export declare function ɵassignExtraOptionsToRouter(opts: ExtraOptions, router:
|
|
|
3629
3629
|
* In order to render, there needs to be a component on this config, which will default
|
|
3630
3630
|
* to this `EmptyOutletComponent`.
|
|
3631
3631
|
*/
|
|
3632
|
-
declare class ɵEmptyOutletComponent {
|
|
3632
|
+
export declare class ɵEmptyOutletComponent {
|
|
3633
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ɵEmptyOutletComponent, never>;
|
|
3634
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ɵEmptyOutletComponent, "ng-component", never, {}, {}, never, never>;
|
|
3633
3635
|
}
|
|
3634
|
-
export { ɵEmptyOutletComponent }
|
|
3635
|
-
export { ɵEmptyOutletComponent as ɵangular_packages_router_router_l }
|
|
3636
3636
|
|
|
3637
3637
|
/**
|
|
3638
3638
|
* Flattens single-level nested arrays.
|
package/testing/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/router/testing",
|
|
3
|
-
"
|
|
4
|
-
"fesm2015": "../fesm2015/testing.
|
|
5
|
-
"
|
|
3
|
+
"fesm2020": "../fesm2020/testing.mjs",
|
|
4
|
+
"fesm2015": "../fesm2015/testing.mjs",
|
|
5
|
+
"esm2020": "../esm2020/testing/testing.mjs",
|
|
6
6
|
"typings": "./testing.d.ts",
|
|
7
|
-
"module": "../fesm2015/testing.
|
|
8
|
-
"
|
|
7
|
+
"module": "../fesm2015/testing.mjs",
|
|
8
|
+
"es2020": "../fesm2020/testing.mjs"
|
|
9
9
|
}
|
package/testing/testing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v13.0.0-
|
|
2
|
+
* @license Angular v13.0.0-rc.1
|
|
3
3
|
* (c) 2010-2021 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
import { ChildrenOutletContexts } from '@angular/router';
|
|
8
8
|
import { Compiler } from '@angular/core';
|
|
9
9
|
import { ExtraOptions } from '@angular/router';
|
|
10
|
+
import * as i0 from '@angular/core';
|
|
11
|
+
import * as i1 from '@angular/router';
|
|
10
12
|
import { Injector } from '@angular/core';
|
|
11
13
|
import { Location as Location_2 } from '@angular/common';
|
|
12
14
|
import { ModuleWithProviders } from '@angular/core';
|
|
13
|
-
import { NgModuleFactory } from '@angular/core';
|
|
14
|
-
import { NgModuleFactoryLoader } from '@angular/core';
|
|
15
15
|
import { Route } from '@angular/router';
|
|
16
16
|
import { Router } from '@angular/router';
|
|
17
|
+
import { RouteReuseStrategy } from '@angular/router';
|
|
17
18
|
import { Routes } from '@angular/router';
|
|
18
19
|
import { UrlHandlingStrategy } from '@angular/router';
|
|
19
20
|
import { UrlSerializer } from '@angular/router';
|
|
@@ -24,8 +25,7 @@ import { UrlSerializer } from '@angular/router';
|
|
|
24
25
|
* Sets up the router to be used for testing.
|
|
25
26
|
*
|
|
26
27
|
* The modules sets up the router to be used for testing.
|
|
27
|
-
* It provides spy implementations of `Location
|
|
28
|
-
* NgModuleFactoryLoader}.
|
|
28
|
+
* It provides spy implementations of `Location` and `LocationStrategy`.
|
|
29
29
|
*
|
|
30
30
|
* @usageNotes
|
|
31
31
|
* ### Example
|
|
@@ -46,6 +46,9 @@ import { UrlSerializer } from '@angular/router';
|
|
|
46
46
|
*/
|
|
47
47
|
export declare class RouterTestingModule {
|
|
48
48
|
static withRoutes(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterTestingModule>;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouterTestingModule, never>;
|
|
50
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<RouterTestingModule, never, never, [typeof i1.RouterModule]>;
|
|
51
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<RouterTestingModule>;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
/**
|
|
@@ -53,66 +56,6 @@ export declare class RouterTestingModule {
|
|
|
53
56
|
*
|
|
54
57
|
* @publicApi
|
|
55
58
|
*/
|
|
56
|
-
export declare function setupTestingRouter(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2,
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Router setup factory function used for testing.
|
|
60
|
-
*
|
|
61
|
-
* @deprecated As of v5.2. The 2nd-to-last argument should be `ExtraOptions`, not
|
|
62
|
-
* `UrlHandlingStrategy`
|
|
63
|
-
* @publicApi
|
|
64
|
-
*/
|
|
65
|
-
export declare function setupTestingRouter(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2, loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][], urlHandlingStrategy?: UrlHandlingStrategy): Router;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @description
|
|
69
|
-
*
|
|
70
|
-
* Allows to simulate the loading of ng modules in tests.
|
|
71
|
-
*
|
|
72
|
-
* ```
|
|
73
|
-
* const loader = TestBed.inject(NgModuleFactoryLoader);
|
|
74
|
-
*
|
|
75
|
-
* @Component({template: 'lazy-loaded'})
|
|
76
|
-
* class LazyLoadedComponent {}
|
|
77
|
-
* @NgModule({
|
|
78
|
-
* declarations: [LazyLoadedComponent],
|
|
79
|
-
* imports: [RouterModule.forChild([{path: 'loaded', component: LazyLoadedComponent}])]
|
|
80
|
-
* })
|
|
81
|
-
*
|
|
82
|
-
* class LoadedModule {}
|
|
83
|
-
*
|
|
84
|
-
* // sets up stubbedModules
|
|
85
|
-
* loader.stubbedModules = {lazyModule: LoadedModule};
|
|
86
|
-
*
|
|
87
|
-
* router.resetConfig([
|
|
88
|
-
* {path: 'lazy', loadChildren: 'lazyModule'},
|
|
89
|
-
* ]);
|
|
90
|
-
*
|
|
91
|
-
* router.navigateByUrl('/lazy/loaded');
|
|
92
|
-
* ```
|
|
93
|
-
*
|
|
94
|
-
* @publicApi
|
|
95
|
-
*/
|
|
96
|
-
export declare class SpyNgModuleFactoryLoader implements NgModuleFactoryLoader {
|
|
97
|
-
private compiler;
|
|
98
|
-
/**
|
|
99
|
-
* @docsNotRequired
|
|
100
|
-
*/
|
|
101
|
-
private _stubbedModules;
|
|
102
|
-
/**
|
|
103
|
-
* @docsNotRequired
|
|
104
|
-
*/
|
|
105
|
-
set stubbedModules(modules: {
|
|
106
|
-
[path: string]: any;
|
|
107
|
-
});
|
|
108
|
-
/**
|
|
109
|
-
* @docsNotRequired
|
|
110
|
-
*/
|
|
111
|
-
get stubbedModules(): {
|
|
112
|
-
[path: string]: any;
|
|
113
|
-
};
|
|
114
|
-
constructor(compiler: Compiler);
|
|
115
|
-
load(path: string): Promise<NgModuleFactory<any>>;
|
|
116
|
-
}
|
|
59
|
+
export declare function setupTestingRouter(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2, compiler: Compiler, injector: Injector, routes: Route[][], opts?: ExtraOptions | UrlHandlingStrategy, urlHandlingStrategy?: UrlHandlingStrategy, routeReuseStrategy?: RouteReuseStrategy): Router;
|
|
117
60
|
|
|
118
61
|
export { }
|
package/upgrade/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/router/upgrade",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"
|
|
5
|
-
"fesm2015": "../fesm2015/upgrade.
|
|
6
|
-
"
|
|
4
|
+
"fesm2020": "../fesm2020/upgrade.mjs",
|
|
5
|
+
"fesm2015": "../fesm2015/upgrade.mjs",
|
|
6
|
+
"esm2020": "../esm2020/upgrade/upgrade.mjs",
|
|
7
7
|
"typings": "./upgrade.d.ts",
|
|
8
|
-
"module": "../fesm2015/upgrade.
|
|
9
|
-
"
|
|
8
|
+
"module": "../fesm2015/upgrade.mjs",
|
|
9
|
+
"es2020": "../fesm2020/upgrade.mjs"
|
|
10
10
|
}
|
package/upgrade/upgrade.d.ts
CHANGED