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

Function createEmptyStateSnapshot

packages/router/src/router_state.ts:100–121  ·  view source on GitHub ↗
(
  rootComponent: Type<any> | null,
  injector: EnvironmentInjector,
)

Source from the content-addressed store, hash-verified

98}
99
100export function createEmptyStateSnapshot(
101 rootComponent: Type<any> | null,
102 injector: EnvironmentInjector,
103): RouterStateSnapshot {
104 const emptyParams = {};
105 const emptyData = {};
106 const emptyQueryParams = {};
107 const fragment = '';
108 const activated = new ActivatedRouteSnapshot(
109 [],
110 emptyParams,
111 emptyQueryParams,
112 fragment,
113 emptyData,
114 PRIMARY_OUTLET,
115 rootComponent,
116 null,
117 {},
118 injector,
119 );
120 return new RouterStateSnapshot('', new TreeNode<ActivatedRouteSnapshot>(activated, []));
121}
122
123/**
124 * Provides access to information about a route associated with a component

Callers 2

router.spec.tsFile · 0.90
createEmptyStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected