MCPcopy
hub / github.com/angular/angular / inject

Function inject

packages/core/src/di/injector_compatibility.ts:293–297  ·  view source on GitHub ↗
(token: ProviderToken<T> | HostAttributeToken, options?: InjectOptions)

Source from the content-addressed store, hash-verified

291 * @publicApi
292 */
293export function inject<T>(token: ProviderToken<T> | HostAttributeToken, options?: InjectOptions) {
294 // The `as any` here _shouldn't_ be necessary, but without it JSCompiler
295 // throws a disambiguation error due to the multiple signatures.
296 return ɵɵinject(token as any, convertToBitFlags(options));
297}
298
299// Converts object-based DI flags (`InjectOptions`) to bit flags (`InjectFlags`).
300export function convertToBitFlags(

Callers 15

TransferStateClass · 0.90
PendingTasksClass · 0.90
error_handler.tsFile · 0.90
constructorMethod · 0.90
injectAsyncFunction · 0.90
onIdleFunction · 0.90
OutputEmitterRefClass · 0.90
TestabilityClass · 0.90
constructorMethod · 0.90

Calls 2

ɵɵinjectFunction · 0.85
convertToBitFlagsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…