MCPcopy
hub / github.com/angular/angular / serialize

Method serialize

packages/router/src/url_tree.ts:455–462  ·  view source on GitHub ↗

Converts a `UrlTree` into a url

(tree: UrlTree)

Source from the content-addressed store, hash-verified

453
454 /** Converts a `UrlTree` into a url */
455 serialize(tree: UrlTree): string {
456 const segment = `/${serializeSegment(tree.root, true)}`;
457 const query = serializeQueryParams(tree.queryParams);
458 const fragment =
459 typeof tree.fragment === `string` ? `#${encodeUriFragment(tree.fragment)}` : '';
460
461 return `${segment}${query}${fragment}`;
462 }
463}
464
465const DEFAULT_SERIALIZER = new DefaultUrlSerializer();

Callers 1

expectTreeToBeFunction · 0.95

Calls 3

serializeSegmentFunction · 0.85
serializeQueryParamsFunction · 0.85
encodeUriFragmentFunction · 0.85

Tested by 1

expectTreeToBeFunction · 0.76