MCPcopy
hub / github.com/angular/angular / get

Method get

packages/core/src/di/null_injector.ts:17–28  ·  view source on GitHub ↗
(token: any, notFoundValue: any = THROW_IF_NOT_FOUND)

Source from the content-addressed store, hash-verified

15
16export class NullInjector implements Injector {
17 get(token: any, notFoundValue: any = THROW_IF_NOT_FOUND): any {
18 if (notFoundValue === THROW_IF_NOT_FOUND) {
19 const message = ngDevMode ? `No provider found for \`${stringify(token)}\`.` : '';
20 const error = createRuntimeError(message, RuntimeErrorCode.PROVIDER_NOT_FOUND);
21
22 // Note: This is the name used by the primitives to identify a not found error.
23 error.name = 'ɵNotFound';
24
25 throw error;
26 }
27 return notFoundValue;
28 }
29}

Callers

nothing calls this directly

Calls 2

stringifyFunction · 0.90
createRuntimeErrorFunction · 0.90

Tested by

no test coverage detected