MCPcopy
hub / github.com/angular/angular / checkOutletNameUniqueness

Function checkOutletNameUniqueness

packages/router/src/recognize.ts:586–601  ·  view source on GitHub ↗
(nodes: TreeNode<ActivatedRouteSnapshot>[])

Source from the content-addressed store, hash-verified

584}
585
586function checkOutletNameUniqueness(nodes: TreeNode<ActivatedRouteSnapshot>[]): void {
587 const names: {[k: string]: ActivatedRouteSnapshot} = {};
588 nodes.forEach((n) => {
589 const routeWithSameOutletName = names[n.value.outlet];
590 if (routeWithSameOutletName) {
591 const p = routeWithSameOutletName.url.map((s) => s.toString()).join('/');
592 const c = n.value.url.map((s) => s.toString()).join('/');
593 throw new RuntimeError(
594 RuntimeErrorCode.TWO_SEGMENTS_WITH_SAME_OUTLET,
595 (typeof ngDevMode === 'undefined' || ngDevMode) &&
596 `Two segments cannot have the same outlet name: '${p}' and '${c}'.`,
597 );
598 }
599 names[n.value.outlet] = n.value;
600 });
601}
602
603function getData(route: Route): Data {
604 return route.data || {};

Callers 1

processChildrenMethod · 0.85

Calls 4

mapMethod · 0.80
joinMethod · 0.65
toStringMethod · 0.65
forEachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…