@angular/router 6.0.0-rc.3 → 6.0.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.
- package/bundles/router-testing.umd.js +54 -9
- package/bundles/router-testing.umd.js.map +1 -1
- package/bundles/router-testing.umd.min.js +5 -4
- package/bundles/router-testing.umd.min.js.map +1 -1
- package/bundles/router-upgrade.umd.js +3 -3
- package/bundles/router-upgrade.umd.js.map +1 -1
- package/bundles/router-upgrade.umd.min.js +2 -2
- package/bundles/router-upgrade.umd.min.js.map +1 -1
- package/bundles/router.umd.js +163 -78
- package/bundles/router.umd.js.map +1 -1
- package/bundles/router.umd.min.js +19 -19
- package/bundles/router.umd.min.js.map +1 -1
- package/esm2015/src/config.js +2 -2
- package/esm2015/src/create_router_state.js +12 -9
- package/esm2015/src/directives/router_link.js +3 -3
- package/esm2015/src/directives/router_link_active.js +2 -2
- package/esm2015/src/directives/router_outlet.js +2 -2
- package/esm2015/src/events.js +6 -6
- package/esm2015/src/interfaces.js +6 -6
- package/esm2015/src/router.js +3 -3
- package/esm2015/src/router_module.js +6 -6
- package/esm2015/src/router_outlet_context.js +3 -3
- package/esm2015/src/router_preloader.js +2 -2
- package/esm2015/src/router_state.js +5 -5
- package/esm2015/src/shared.js +4 -4
- package/esm2015/src/url_tree.js +6 -6
- package/esm2015/src/version.js +3 -3
- package/esm2015/testing/src/router_testing_module.js +4 -4
- package/esm5/src/config.js +1 -1
- package/esm5/src/create_router_state.js +12 -9
- package/esm5/src/directives/router_link.js +3 -3
- package/esm5/src/directives/router_link_active.js +2 -2
- package/esm5/src/directives/router_outlet.js +2 -2
- package/esm5/src/events.js +16 -16
- package/esm5/src/interfaces.js +1 -1
- package/esm5/src/router.js +4 -4
- package/esm5/src/router_module.js +5 -5
- package/esm5/src/router_outlet_context.js +7 -7
- package/esm5/src/router_preloader.js +2 -2
- package/esm5/src/router_state.js +13 -13
- package/esm5/src/shared.js +3 -3
- package/esm5/src/url_tree.js +16 -16
- package/esm5/src/version.js +3 -3
- package/esm5/testing/src/router_testing_module.js +4 -4
- package/fesm2015/router.js +46 -43
- package/fesm2015/router.js.map +1 -1
- package/fesm2015/testing.js +4 -4
- package/fesm2015/testing.js.map +1 -1
- package/fesm2015/upgrade.js +1 -1
- package/fesm2015/upgrade.js.map +1 -1
- package/fesm5/router.js +42 -39
- package/fesm5/router.js.map +1 -1
- package/fesm5/testing.js +4 -4
- package/fesm5/testing.js.map +1 -1
- package/fesm5/upgrade.js +1 -1
- package/fesm5/upgrade.js.map +1 -1
- package/package.json +7 -6
- package/router.metadata.json +1 -1
- package/src/config.d.ts +7 -7
- package/src/directives/router_link.d.ts +2 -2
- package/src/directives/router_link_active.d.ts +1 -1
- package/src/directives/router_outlet.d.ts +1 -1
- package/src/events.d.ts +6 -6
- package/src/interfaces.d.ts +5 -5
- package/src/router.d.ts +3 -3
- package/src/router_module.d.ts +4 -4
- package/src/router_outlet_context.d.ts +2 -2
- package/src/router_preloader.d.ts +1 -1
- package/src/router_state.d.ts +4 -4
- package/src/shared.d.ts +4 -4
- package/src/url_tree.d.ts +5 -5
- package/src/version.d.ts +1 -1
- package/testing/src/router_testing_module.d.ts +3 -3
- package/testing.d.ts +1 -1
- package/upgrade.d.ts +1 -1
package/src/events.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export declare class RouterEvent {
|
|
|
55
55
|
*
|
|
56
56
|
* Represents an event triggered when a navigation starts.
|
|
57
57
|
*
|
|
58
|
-
*
|
|
58
|
+
*
|
|
59
59
|
*/
|
|
60
60
|
export declare class NavigationStart extends RouterEvent {
|
|
61
61
|
/**
|
|
@@ -100,7 +100,7 @@ export declare class NavigationStart extends RouterEvent {
|
|
|
100
100
|
*
|
|
101
101
|
* Represents an event triggered when a navigation ends successfully.
|
|
102
102
|
*
|
|
103
|
-
*
|
|
103
|
+
*
|
|
104
104
|
*/
|
|
105
105
|
export declare class NavigationEnd extends RouterEvent {
|
|
106
106
|
/** @docsNotRequired */
|
|
@@ -120,7 +120,7 @@ export declare class NavigationEnd extends RouterEvent {
|
|
|
120
120
|
*
|
|
121
121
|
* Represents an event triggered when a navigation is canceled.
|
|
122
122
|
*
|
|
123
|
-
*
|
|
123
|
+
*
|
|
124
124
|
*/
|
|
125
125
|
export declare class NavigationCancel extends RouterEvent {
|
|
126
126
|
/** @docsNotRequired */
|
|
@@ -140,7 +140,7 @@ export declare class NavigationCancel extends RouterEvent {
|
|
|
140
140
|
*
|
|
141
141
|
* Represents an event triggered when a navigation fails due to an unexpected error.
|
|
142
142
|
*
|
|
143
|
-
*
|
|
143
|
+
*
|
|
144
144
|
*/
|
|
145
145
|
export declare class NavigationError extends RouterEvent {
|
|
146
146
|
/** @docsNotRequired */
|
|
@@ -160,7 +160,7 @@ export declare class NavigationError extends RouterEvent {
|
|
|
160
160
|
*
|
|
161
161
|
* Represents an event triggered when routes are recognized.
|
|
162
162
|
*
|
|
163
|
-
*
|
|
163
|
+
*
|
|
164
164
|
*/
|
|
165
165
|
export declare class RoutesRecognized extends RouterEvent {
|
|
166
166
|
/** @docsNotRequired */
|
|
@@ -396,6 +396,6 @@ export declare class ActivationEnd {
|
|
|
396
396
|
* - `NavigationCancel`,
|
|
397
397
|
* - `NavigationError`
|
|
398
398
|
*
|
|
399
|
-
*
|
|
399
|
+
*
|
|
400
400
|
*/
|
|
401
401
|
export declare type Event = RouterEvent | RouteConfigLoadStart | RouteConfigLoadEnd | ChildActivationStart | ChildActivationEnd | ActivationStart | ActivationEnd;
|
package/src/interfaces.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ import { ActivatedRouteSnapshot, RouterStateSnapshot } from './router_state';
|
|
|
71
71
|
* class AppModule {}
|
|
72
72
|
* ```
|
|
73
73
|
*
|
|
74
|
-
*
|
|
74
|
+
*
|
|
75
75
|
*/
|
|
76
76
|
export interface CanActivate {
|
|
77
77
|
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean;
|
|
@@ -149,7 +149,7 @@ export interface CanActivate {
|
|
|
149
149
|
* class AppModule {}
|
|
150
150
|
* ```
|
|
151
151
|
*
|
|
152
|
-
*
|
|
152
|
+
*
|
|
153
153
|
*/
|
|
154
154
|
export interface CanActivateChild {
|
|
155
155
|
canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean;
|
|
@@ -220,7 +220,7 @@ export interface CanActivateChild {
|
|
|
220
220
|
* class AppModule {}
|
|
221
221
|
* ```
|
|
222
222
|
*
|
|
223
|
-
*
|
|
223
|
+
*
|
|
224
224
|
*/
|
|
225
225
|
export interface CanDeactivate<T> {
|
|
226
226
|
canDeactivate(component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean;
|
|
@@ -290,7 +290,7 @@ export interface CanDeactivate<T> {
|
|
|
290
290
|
* })
|
|
291
291
|
* class AppModule {}
|
|
292
292
|
* ```
|
|
293
|
-
*
|
|
293
|
+
*
|
|
294
294
|
*/
|
|
295
295
|
export interface Resolve<T> {
|
|
296
296
|
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<T> | Promise<T> | T;
|
|
@@ -357,7 +357,7 @@ export interface Resolve<T> {
|
|
|
357
357
|
* class AppModule {}
|
|
358
358
|
* ```
|
|
359
359
|
*
|
|
360
|
-
*
|
|
360
|
+
*
|
|
361
361
|
*/
|
|
362
362
|
export interface CanLoad {
|
|
363
363
|
canLoad(route: Route): Observable<boolean> | Promise<boolean> | boolean;
|
package/src/router.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { UrlSerializer, UrlTree } from './url_tree';
|
|
|
21
21
|
*
|
|
22
22
|
* Represents the extra options used during navigation.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
24
|
+
*
|
|
25
25
|
*/
|
|
26
26
|
export interface NavigationExtras {
|
|
27
27
|
/**
|
|
@@ -134,7 +134,7 @@ export interface NavigationExtras {
|
|
|
134
134
|
* If the handler throws an exception, the navigation promise will be rejected with
|
|
135
135
|
* the exception.
|
|
136
136
|
*
|
|
137
|
-
*
|
|
137
|
+
*
|
|
138
138
|
*/
|
|
139
139
|
export declare type ErrorHandler = (error: any) => any;
|
|
140
140
|
/**
|
|
@@ -146,7 +146,7 @@ export declare type ErrorHandler = (error: any) => any;
|
|
|
146
146
|
*
|
|
147
147
|
* @ngModule RouterModule
|
|
148
148
|
*
|
|
149
|
-
*
|
|
149
|
+
*
|
|
150
150
|
*/
|
|
151
151
|
export declare class Router {
|
|
152
152
|
private rootComponentType;
|
package/src/router_module.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import { UrlSerializer } from './url_tree';
|
|
|
19
19
|
*
|
|
20
20
|
* Is used in DI to configure the router.
|
|
21
21
|
*
|
|
22
|
-
*
|
|
22
|
+
*
|
|
23
23
|
*/
|
|
24
24
|
export declare const ROUTER_CONFIGURATION: InjectionToken<ExtraOptions>;
|
|
25
25
|
/**
|
|
@@ -77,7 +77,7 @@ export declare function routerNgProbeToken(): NgProbeToken;
|
|
|
77
77
|
* [Read this developer guide](https://angular.io/docs/ts/latest/guide/router.html) to get an
|
|
78
78
|
* overview of how the router should be used.
|
|
79
79
|
*
|
|
80
|
-
*
|
|
80
|
+
*
|
|
81
81
|
*/
|
|
82
82
|
export declare class RouterModule {
|
|
83
83
|
constructor(guard: any, router: Router);
|
|
@@ -118,7 +118,7 @@ export declare function provideForRootGuard(router: Router): any;
|
|
|
118
118
|
* class MyNgModule {}
|
|
119
119
|
* ```
|
|
120
120
|
*
|
|
121
|
-
*
|
|
121
|
+
*
|
|
122
122
|
*/
|
|
123
123
|
export declare function provideRoutes(routes: Routes): any;
|
|
124
124
|
/**
|
|
@@ -152,7 +152,7 @@ export declare type InitialNavigation = true | false | 'enabled' | 'disabled' |
|
|
|
152
152
|
*
|
|
153
153
|
* Represents options to configure the router.
|
|
154
154
|
*
|
|
155
|
-
*
|
|
155
|
+
*
|
|
156
156
|
*/
|
|
157
157
|
export interface ExtraOptions {
|
|
158
158
|
/**
|
|
@@ -11,7 +11,7 @@ import { ActivatedRoute } from './router_state';
|
|
|
11
11
|
/**
|
|
12
12
|
* Store contextual information about a `RouterOutlet`
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
15
|
*/
|
|
16
16
|
export declare class OutletContext {
|
|
17
17
|
outlet: RouterOutlet | null;
|
|
@@ -23,7 +23,7 @@ export declare class OutletContext {
|
|
|
23
23
|
/**
|
|
24
24
|
* Store contextual information about the children (= nested) `RouterOutlet`
|
|
25
25
|
*
|
|
26
|
-
*
|
|
26
|
+
*
|
|
27
27
|
*/
|
|
28
28
|
export declare class ChildrenOutletContexts {
|
|
29
29
|
private contexts;
|
|
@@ -55,7 +55,7 @@ export declare class NoPreloading implements PreloadingStrategy {
|
|
|
55
55
|
*
|
|
56
56
|
* If a route is protected by `canLoad` guards, the preloaded will not load it.
|
|
57
57
|
*
|
|
58
|
-
*
|
|
58
|
+
*
|
|
59
59
|
*/
|
|
60
60
|
export declare class RouterPreloader implements OnDestroy {
|
|
61
61
|
private router;
|
package/src/router_state.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ import { Tree } from './utils/tree';
|
|
|
36
36
|
*
|
|
37
37
|
* See `ActivatedRoute` for more information.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
39
|
+
*
|
|
40
40
|
*/
|
|
41
41
|
export declare class RouterState extends Tree<ActivatedRoute> {
|
|
42
42
|
/** The current snapshot of the router state */
|
|
@@ -63,7 +63,7 @@ export declare function createEmptyStateSnapshot(urlTree: UrlTree, rootComponent
|
|
|
63
63
|
* }
|
|
64
64
|
* ```
|
|
65
65
|
*
|
|
66
|
-
*
|
|
66
|
+
*
|
|
67
67
|
*/
|
|
68
68
|
export declare class ActivatedRoute {
|
|
69
69
|
/** An observable of the URL segments matched by this route */
|
|
@@ -117,7 +117,7 @@ export declare type ParamsInheritanceStrategy = 'emptyOnly' | 'always';
|
|
|
117
117
|
* }
|
|
118
118
|
* ```
|
|
119
119
|
*
|
|
120
|
-
*
|
|
120
|
+
*
|
|
121
121
|
*/
|
|
122
122
|
export declare class ActivatedRouteSnapshot {
|
|
123
123
|
/** The URL segments matched by this route */
|
|
@@ -174,7 +174,7 @@ export declare class ActivatedRouteSnapshot {
|
|
|
174
174
|
* }
|
|
175
175
|
* ```
|
|
176
176
|
*
|
|
177
|
-
*
|
|
177
|
+
*
|
|
178
178
|
*/
|
|
179
179
|
export declare class RouterStateSnapshot extends Tree<ActivatedRouteSnapshot> {
|
|
180
180
|
/** The url from which this snapshot was created */
|
package/src/shared.d.ts
CHANGED
|
@@ -12,13 +12,13 @@ import { UrlSegment, UrlSegmentGroup } from './url_tree';
|
|
|
12
12
|
*
|
|
13
13
|
* Name of the primary outlet.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
*
|
|
16
16
|
*/
|
|
17
17
|
export declare const PRIMARY_OUTLET = "primary";
|
|
18
18
|
/**
|
|
19
19
|
* A collection of parameters.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
21
|
+
*
|
|
22
22
|
*/
|
|
23
23
|
export declare type Params = {
|
|
24
24
|
[key: string]: any;
|
|
@@ -33,7 +33,7 @@ export declare type Params = {
|
|
|
33
33
|
* The API is inspired by the URLSearchParams interface.
|
|
34
34
|
* see https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
|
|
35
35
|
*
|
|
36
|
-
*
|
|
36
|
+
*
|
|
37
37
|
*/
|
|
38
38
|
export interface ParamMap {
|
|
39
39
|
has(name: string): boolean;
|
|
@@ -56,7 +56,7 @@ export interface ParamMap {
|
|
|
56
56
|
/**
|
|
57
57
|
* Convert a `Params` instance to a `ParamMap`.
|
|
58
58
|
*
|
|
59
|
-
*
|
|
59
|
+
*
|
|
60
60
|
*/
|
|
61
61
|
export declare function convertToParamMap(params: Params): ParamMap;
|
|
62
62
|
export declare function navigationCancelingError(message: string): Error;
|
package/src/url_tree.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare function containsTree(container: UrlTree, containee: UrlTree, exa
|
|
|
35
35
|
* }
|
|
36
36
|
* ```
|
|
37
37
|
*
|
|
38
|
-
*
|
|
38
|
+
*
|
|
39
39
|
*/
|
|
40
40
|
export declare class UrlTree {
|
|
41
41
|
/** The root segment group of the URL tree */
|
|
@@ -57,7 +57,7 @@ export declare class UrlTree {
|
|
|
57
57
|
*
|
|
58
58
|
* See `UrlTree` for more information.
|
|
59
59
|
*
|
|
60
|
-
*
|
|
60
|
+
*
|
|
61
61
|
*/
|
|
62
62
|
export declare class UrlSegmentGroup {
|
|
63
63
|
/** The URL segments of this group. See `UrlSegment` for more information */
|
|
@@ -105,7 +105,7 @@ export declare class UrlSegmentGroup {
|
|
|
105
105
|
* }
|
|
106
106
|
* ```
|
|
107
107
|
*
|
|
108
|
-
*
|
|
108
|
+
*
|
|
109
109
|
*/
|
|
110
110
|
export declare class UrlSegment {
|
|
111
111
|
/** The path part of a URL segment */
|
|
@@ -138,7 +138,7 @@ export declare function mapChildrenIntoArray<T>(segment: UrlSegmentGroup, fn: (v
|
|
|
138
138
|
*
|
|
139
139
|
* See `DefaultUrlSerializer` for an example of a URL serializer.
|
|
140
140
|
*
|
|
141
|
-
*
|
|
141
|
+
*
|
|
142
142
|
*/
|
|
143
143
|
export declare abstract class UrlSerializer {
|
|
144
144
|
/** Parse a url into a `UrlTree` */
|
|
@@ -162,7 +162,7 @@ export declare abstract class UrlSerializer {
|
|
|
162
162
|
* colon syntax to specify the outlet, and the ';parameter=value' syntax (e.g., open=true) to
|
|
163
163
|
* specify route specific parameters.
|
|
164
164
|
*
|
|
165
|
-
*
|
|
165
|
+
*
|
|
166
166
|
*/
|
|
167
167
|
export declare class DefaultUrlSerializer implements UrlSerializer {
|
|
168
168
|
/** Parses a url into a `UrlTree` */
|
package/src/version.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ import { ChildrenOutletContexts, ExtraOptions, Route, Router, Routes, UrlHandlin
|
|
|
35
35
|
* router.navigateByUrl('/lazy/loaded');
|
|
36
36
|
* ```
|
|
37
37
|
*
|
|
38
|
-
*
|
|
38
|
+
*
|
|
39
39
|
*/
|
|
40
40
|
export declare class SpyNgModuleFactoryLoader implements NgModuleFactoryLoader {
|
|
41
41
|
private compiler;
|
|
@@ -58,7 +58,7 @@ export declare class SpyNgModuleFactoryLoader implements NgModuleFactoryLoader {
|
|
|
58
58
|
/**
|
|
59
59
|
* Router setup factory function used for testing.
|
|
60
60
|
*
|
|
61
|
-
*
|
|
61
|
+
*
|
|
62
62
|
*/
|
|
63
63
|
export declare function setupTestingRouter(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location, loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][], opts?: ExtraOptions, urlHandlingStrategy?: UrlHandlingStrategy): Router;
|
|
64
64
|
/**
|
|
@@ -91,7 +91,7 @@ export declare function setupTestingRouter(urlSerializer: UrlSerializer, context
|
|
|
91
91
|
* });
|
|
92
92
|
* ```
|
|
93
93
|
*
|
|
94
|
-
*
|
|
94
|
+
*
|
|
95
95
|
*/
|
|
96
96
|
export declare class RouterTestingModule {
|
|
97
97
|
static withRoutes(routes: Routes, config?: ExtraOptions): ModuleWithProviders;
|
package/testing.d.ts
CHANGED
package/upgrade.d.ts
CHANGED