| 612 | } |
| 613 | |
| 614 | function checkOutletNameUniqueness(nodes: TreeNode<ActivatedRouteSnapshot>[]): void { |
| 615 | const names: {[k: string]: ActivatedRouteSnapshot} = Object.create(null); |
| 616 | nodes.forEach((n) => { |
| 617 | const routeWithSameOutletName = names[n.value.outlet]; |
| 618 | if (routeWithSameOutletName) { |
| 619 | const p = routeWithSameOutletName.url.map((s) => s.toString()).join('/'); |
| 620 | const c = n.value.url.map((s) => s.toString()).join('/'); |
| 621 | throw new RuntimeError( |
| 622 | RuntimeErrorCode.TWO_SEGMENTS_WITH_SAME_OUTLET, |
| 623 | (typeof ngDevMode === 'undefined' || ngDevMode) && |
| 624 | `Two segments cannot have the same outlet name: '${p}' and '${c}'.`, |
| 625 | ); |
| 626 | } |
| 627 | names[n.value.outlet] = n.value; |
| 628 | }); |
| 629 | } |
| 630 | |
| 631 | function getData(route: Route): Data { |
| 632 | return route.data || {}; |