Skip to content

Instantly share code, notes, and snippets.

@nathan-lapinski
Created September 12, 2018 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathan-lapinski/2acf124d6361790f0653fa873f4789d6 to your computer and use it in GitHub Desktop.
Save nathan-lapinski/2acf124d6361790f0653fa873f4789d6 to your computer and use it in GitHub Desktop.
Apply a redirect, and create a new url tree
private applyRedirectCreatreUrlTree(
redirectTo: string, urlTree: UrlTree, segments: UrlSegment[],
posParams: {[k: string]: UrlSegment}): UrlTree {
const newRoot = this.createSegmentGroup(redirectTo, urlTree.root, segments, posParams);
return new UrlTree(
newRoot, this.createQueryParams(urlTree.queryParams, this.urlTree.queryParams),
urlTree.fragment);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment