(rootSegmentGroup: UrlSegmentGroup)
| 115 | } |
| 116 | |
| 117 | private async match(rootSegmentGroup: UrlSegmentGroup): Promise<{ |
| 118 | children: TreeNode<ActivatedRouteSnapshot>[]; |
| 119 | rootSnapshot: ActivatedRouteSnapshot; |
| 120 | }> { |
| 121 | // Use Object.freeze to prevent readers of the Router state from modifying it outside |
| 122 | // of a navigation, resulting in the router being out of sync with the browser. |
| 123 | const rootSnapshot = new ActivatedRouteSnapshot( |
| 124 | [], |
| 125 | Object.freeze({}), |
| 126 | Object.freeze({...this.urlTree.queryParams}), |
| 127 | this.urlTree.fragment, |
| 128 | Object.freeze({}), |
| 129 | PRIMARY_OUTLET, |
| 130 | this.rootComponentType, |
| 131 | null, |
| 132 | {}, |
| 133 | this.injector, |
| 134 | ); |
| 135 | try { |
| 136 | const children = await this.processSegmentGroup( |
| 137 | this.injector, |
| 138 | this.config, |
| 139 | rootSegmentGroup, |
| 140 | PRIMARY_OUTLET, |
| 141 | rootSnapshot, |
| 142 | ); |
| 143 | return {children, rootSnapshot}; |
| 144 | } catch (e: any) { |
| 145 | if (e instanceof AbsoluteRedirect) { |
| 146 | this.urlTree = e.urlTree; |
| 147 | return this.match(e.urlTree.root); |
| 148 | } |
| 149 | if (e instanceof NoMatch) { |
| 150 | throw this.noMatchError(e); |
| 151 | } |
| 152 | |
| 153 | throw e; |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | async processSegmentGroup( |
| 158 | injector: EnvironmentInjector, |
no test coverage detected