feat(router): add queryParams and fragment to every activated route

This commit is contained in:
vsavkin
2016-08-02 15:31:56 -07:00
committed by Alex Rickabaugh
parent 550ab31bd0
commit 422d380b3e
8 changed files with 192 additions and 181 deletions

View File

@ -649,7 +649,6 @@ class ActivateRoutes {
const currRoot = this.currState ? this.currState._root : null;
advanceActivatedRoute(this.futureState.root);
this.activateChildRoutes(futureRoot, currRoot, parentOutletMap);
pushQueryParamsAndFragment(this.futureState);
}
private activateChildRoutes(
@ -758,16 +757,6 @@ function closestLoadedConfig(
return b.length > 0 ? (<any>b[b.length - 1])._routeConfig._loadedConfig : null;
}
function pushQueryParamsAndFragment(state: RouterState): void {
if (!shallowEqual(state.snapshot.queryParams, (<any>state.queryParams).value)) {
(<any>state.queryParams).next(state.snapshot.queryParams);
}
if (state.snapshot.fragment !== (<any>state.fragment).value) {
(<any>state.fragment).next(state.snapshot.fragment);
}
}
function nodeChildrenAsMap(node: TreeNode<any>) {
return node ? node.children.reduce((m: any, c: TreeNode<any>) => {
m[c.value.outlet] = c;