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

Function createEmptyState

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

Source from the content-addressed store, hash-verified

64}
65
66export function createEmptyState(
67 rootComponent: Type<any> | null,
68 injector: EnvironmentInjector,
69): RouterState {
70 const snapshot = createEmptyStateSnapshot(rootComponent, injector);
71 const emptyUrl = new BehaviorSubject([new UrlSegment('', {})]);
72 const emptyParams = new BehaviorSubject({});
73 const emptyData = new BehaviorSubject({});
74 const emptyQueryParams = new BehaviorSubject({});
75 const fragment = new BehaviorSubject<string | null>('');
76 const activated = new ActivatedRoute(
77 emptyUrl,
78 emptyParams,
79 emptyQueryParams,
80 fragment,
81 emptyData,
82 PRIMARY_OUTLET,
83 rootComponent,
84 snapshot.root,
85 );
86 activated.snapshot = snapshot.root;
87 return new RouterState(new TreeNode<ActivatedRoute>(activated, []), snapshot);
88}
89
90export function createEmptyStateSnapshot(
91 rootComponent: Type<any> | null,

Callers 3

emptyStateFunction · 0.90
setupNavigationsMethod · 0.90
state_manager.tsFile · 0.90

Calls 1

createEmptyStateSnapshotFunction · 0.85

Tested by 1

emptyStateFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…