MCPcopy Index your code
hub / github.com/angular/angular / configureRouter

Function configureRouter

packages/router/test/integration/guards.spec.ts:609–676  ·  view source on GitHub ↗
(
          router: Router,
          runGuardsAndResolvers: RunGuardsAndResolvers,
        )

Source from the content-addressed store, hash-verified

607 });
608
609 async function configureRouter(
610 router: Router,
611 runGuardsAndResolvers: RunGuardsAndResolvers,
612 ): Promise<ComponentFixture<RootCmpWithTwoOutlets>> {
613 const fixture = await createRoot(router, RootCmpWithTwoOutlets);
614
615 router.resetConfig([
616 {
617 path: 'a',
618 runGuardsAndResolvers,
619 component: RouteCmp,
620 canActivate: [
621 () => {
622 guardRunCount++;
623 return true;
624 },
625 ],
626 resolve: {data: 'resolver'},
627 },
628 {path: 'b', component: SimpleCmp, outlet: 'right'},
629 {
630 path: 'c/:param',
631 runGuardsAndResolvers,
632 component: RouteCmp,
633 canActivate: [
634 () => {
635 guardRunCount++;
636 return true;
637 },
638 ],
639 resolve: {data: 'resolver'},
640 },
641 {
642 path: 'd/:param',
643 component: WrapperCmp,
644 runGuardsAndResolvers,
645 children: [
646 {
647 path: 'e/:param',
648 component: SimpleCmp,
649 canActivate: [
650 () => {
651 guardRunCount++;
652 return true;
653 },
654 ],
655 resolve: {data: 'resolver'},
656 },
657 ],
658 },
659 {
660 path: 'throwing',
661 runGuardsAndResolvers,
662 component: ThrowingCmp,
663 canActivate: [
664 () => {
665 guardRunCount++;
666 return true;

Callers 1

guardsIntegrationSuiteFunction · 0.85

Calls 4

createRootFunction · 0.90
advanceFunction · 0.90
resetConfigMethod · 0.80
navigateByUrlMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…