fix(router): expose initalNavigation and dispose so they can be used with webworkers
This commit is contained in:
@ -47,7 +47,8 @@ export function recognize(rootComponentType: Type, config: Routes, urlTree: UrlT
|
||||
[], Object.freeze({}), {}, PRIMARY_OUTLET, rootComponentType, null, urlTree.root, -1,
|
||||
InheritedResolve.empty);
|
||||
const rootNode = new TreeNode<ActivatedRouteSnapshot>(root, children);
|
||||
return of (new RouterStateSnapshot(url, rootNode, Object.freeze(urlTree.queryParams), urlTree.fragment));
|
||||
return of (new RouterStateSnapshot(
|
||||
url, rootNode, Object.freeze(urlTree.queryParams), urlTree.fragment));
|
||||
} catch (e) {
|
||||
if (e instanceof NoMatch) {
|
||||
return new Observable<RouterStateSnapshot>(
|
||||
@ -113,9 +114,9 @@ function processPathsWithParamsAgainstRoute(
|
||||
if (route.path === '**') {
|
||||
const params = paths.length > 0 ? last(paths).parameters : {};
|
||||
const snapshot = new ActivatedRouteSnapshot(
|
||||
paths, Object.freeze(merge(inherited.allParams, params)), merge(inherited.allData, getData(route)), outlet,
|
||||
route.component, route, getSourceSegment(rawSegment), getPathIndexShift(rawSegment) - 1,
|
||||
newInheritedResolve);
|
||||
paths, Object.freeze(merge(inherited.allParams, params)),
|
||||
merge(inherited.allData, getData(route)), outlet, route.component, route,
|
||||
getSourceSegment(rawSegment), getPathIndexShift(rawSegment) - 1, newInheritedResolve);
|
||||
return [new TreeNode<ActivatedRouteSnapshot>(snapshot, [])];
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ export class Router {
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* Sets up the location change listener and performs the inital navigation
|
||||
*/
|
||||
initialNavigation(): void {
|
||||
this.setUpLocationChangeListener();
|
||||
@ -185,7 +185,7 @@ export class Router {
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* Disposes of the router.
|
||||
*/
|
||||
dispose(): void { this.locationSubscription.unsubscribe(); }
|
||||
|
||||
|
Reference in New Issue
Block a user