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

Function createEmptyStateSnapshot

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

Source from the content-addressed store, hash-verified

96}
97
98export function createEmptyStateSnapshot(
99 rootComponent: Type<any> | null,
100 injector: EnvironmentInjector,
101): RouterStateSnapshot {
102 const emptyParams = {};
103 const emptyData = {};
104 const emptyQueryParams = {};
105 const fragment = '';
106 const activated = new ActivatedRouteSnapshot(
107 [],
108 emptyParams,
109 emptyQueryParams,
110 fragment,
111 emptyData,
112 PRIMARY_OUTLET,
113 rootComponent,
114 null,
115 {},
116 injector,
117 );
118 return new RouterStateSnapshot('', new TreeNode<ActivatedRouteSnapshot>(activated, []));
119}
120
121/**
122 * 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