MCPcopy Create free account
hub / github.com/angular/angular / configureRouter

Function configureRouter

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

Source from the content-addressed store, hash-verified

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