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

Method processSegmentGroup

packages/router/src/recognize.ts:173–197  ·  view source on GitHub ↗
(
    injector: EnvironmentInjector,
    config: Route[],
    segmentGroup: UrlSegmentGroup,
    outlet: string,
    parentRoute: ActivatedRouteSnapshot,
  )

Source from the content-addressed store, hash-verified

171 }
172
173 async processSegmentGroup(
174 injector: EnvironmentInjector,
175 config: Route[],
176 segmentGroup: UrlSegmentGroup,
177 outlet: string,
178 parentRoute: ActivatedRouteSnapshot,
179 ): Promise<TreeNode<ActivatedRouteSnapshot>[] | NoMatch | AbsoluteRedirect> {
180 if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {
181 return this.processChildren(injector, config, segmentGroup, parentRoute);
182 }
183
184 const child = await this.processSegment(
185 injector,
186 config,
187 segmentGroup,
188 segmentGroup.segments,
189 outlet,
190 true,
191 parentRoute,
192 );
193 if (child instanceof NoMatch || child instanceof AbsoluteRedirect) {
194 return child;
195 }
196 return child instanceof TreeNode ? [child] : [];
197 }
198
199 /**
200 * Matches every child outlet in the `segmentGroup` to a `Route` in the config. Returns `NoMatch`

Callers 1

matchMethod · 0.95

Calls 3

processChildrenMethod · 0.95
processSegmentMethod · 0.95
hasChildrenMethod · 0.45

Tested by

no test coverage detected