Skip to content

Instantly share code, notes, and snippets.

@nathan-lapinski
Created September 10, 2018 01:53
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/efffc9184a09e88728dff4cd32d373a0 to your computer and use it in GitHub Desktop.
Save nathan-lapinski/efffc9184a09e88728dff4cd32d373a0 to your computer and use it in GitHub Desktop.
Excerpt from processSegmentAgainstUrl from Angular's Router module
const result: MatchResult = match(rawSegment, route, segments);
consumedSegments = result.consumedSegments;
rawSlicedSegments = segments.slice(result.lastChild);
snapshot = new ActivatedRouteSnapshot(
consumedSegments, result.parameters, Object.freeze({...this.urlTree.queryParams}),
this.urlTree.fragment !, getData(route), outlet, route.component !, route,
getSourceSegmentGroup(rawSegment),
getPathIndexShift(rawSegment) + consumedSegments.length, getResolve(route));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment