( rootComponent: Type<any> | null, injector: EnvironmentInjector, )
| 64 | } |
| 65 | |
| 66 | export 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 | |
| 90 | export function createEmptyStateSnapshot( |
| 91 | rootComponent: Type<any> | null, |
searching dependent graphs…