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

Function getRedirectResult

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

Source from the content-addressed store, hash-verified

172}
173
174function getRedirectResult(
175 redirectTo: string | RedirectFunction,
176 currentSnapshot: PartialMatchRouteSnapshot,
177 injector: Injector,
178): Promise<string | UrlTree> {
179 if (typeof redirectTo === 'string') {
180 return Promise.resolve(redirectTo);
181 }
182 const redirectToFn = redirectTo;
183 return firstValueFrom(
184 wrapIntoObservable(runInInjectionContext(injector, () => redirectToFn(currentSnapshot))),
185 );
186}

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