| 72 | } |
| 73 | |
| 74 | export function createEmptyState( |
| 75 | rootComponent: Type<any> | null, |
| 76 | injector: EnvironmentInjector, |
| 77 | ): RouterState { |
| 78 | const snapshot = createEmptyStateSnapshot(rootComponent, injector); |
| 79 | const emptyUrl = new BehaviorSubject([new UrlSegment('', {})]); |
| 80 | const emptyParams = new BehaviorSubject({}); |
| 81 | const emptyData = new BehaviorSubject({}); |
| 82 | const emptyQueryParams = new BehaviorSubject({}); |
| 83 | const fragment = new BehaviorSubject<string | null>(''); |
| 84 | const activated = new ActivatedRoute( |
| 85 | emptyUrl, |
| 86 | emptyParams, |
| 87 | emptyQueryParams, |
| 88 | fragment, |
| 89 | emptyData, |
| 90 | PRIMARY_OUTLET, |
| 91 | rootComponent, |
| 92 | snapshot.root, |
| 93 | ); |
| 94 | activated.snapshot = snapshot.root; |
| 95 | return new RouterState(new TreeNode<ActivatedRoute>(activated, []), snapshot); |
| 96 | } |
| 97 | |
| 98 | export function createEmptyStateSnapshot( |
| 99 | rootComponent: Type<any> | null, |