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

Function getRedirectResult

packages/router/src/apply_redirects.ts:195–207  ·  view source on GitHub ↗
(
  redirectTo: string | RedirectFunction,
  currentSnapshot: PartialMatchRouteSnapshot,
  injector: Injector,
)

Source from the content-addressed store, hash-verified

193}
194
195function getRedirectResult(
196 redirectTo: string | RedirectFunction,
197 currentSnapshot: PartialMatchRouteSnapshot,
198 injector: Injector,
199): Promise<string | UrlTree> {
200 if (typeof redirectTo === 'string') {
201 return Promise.resolve(redirectTo);
202 }
203 const redirectToFn = redirectTo;
204 return firstValueFrom(
205 wrapIntoObservable(runInInjectionContext(injector, () => redirectToFn(currentSnapshot))),
206 );
207}

Callers 1

applyRedirectCommandsMethod · 0.85

Calls 4

firstValueFromFunction · 0.90
wrapIntoObservableFunction · 0.90
runInInjectionContextFunction · 0.90
resolveMethod · 0.65

Tested by

no test coverage detected