MCPcopy Index your code
hub / github.com/angular/angular / notFoundValueOrThrow

Function notFoundValueOrThrow

packages/core/src/render3/di.ts:386–396  ·  view source on GitHub ↗
(
  notFoundValue: T | null,
  token: ProviderToken<T>,
  flags: InternalInjectFlags,
)

Source from the content-addressed store, hash-verified

384}
385
386function notFoundValueOrThrow<T>(
387 notFoundValue: T | null,
388 token: ProviderToken<T>,
389 flags: InternalInjectFlags,
390): T | null {
391 if (flags & InternalInjectFlags.Optional || notFoundValue !== undefined) {
392 return notFoundValue;
393 } else {
394 throwProviderNotFoundError(token, 'NodeInjector');
395 }
396}
397
398/**
399 * Returns the value associated to the given token from the ModuleInjector or throws exception

Callers 2

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…