mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs(core): Update inject error documentation (#47020)
The inject function is also available when using EnvironmentInjector.runInContext. PR Close #47020
This commit is contained in:
committed by
Andrew Kushnir
parent
cb42788785
commit
9e3994c7cc
@@ -57,7 +57,7 @@ export function injectInjectorOnly<T>(token: ProviderToken<T>, flags = InjectFla
|
||||
throw new RuntimeError(
|
||||
RuntimeErrorCode.MISSING_INJECTION_CONTEXT,
|
||||
ngDevMode &&
|
||||
`inject() must be called from an injection context (a constructor, a factory function or a field initializer)`);
|
||||
`inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \`EnvironmentInjector#runInContext\`.`);
|
||||
} else if (_currentInjector === null) {
|
||||
return injectRootLimpMode(token, undefined, flags);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user