You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Error: NG0203: 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`. Find more at https://angular.io/errors/NG0203
error properties: Object({ code: -203 })
Error: NG0203: 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`. Find more at https://angular.io/errors/NG0203
at injectInjectorOnly (node_modules/@angular/core/fesm2015/core.mjs:4754:15)
at ɵɵinject (node_modules/@angular/core/fesm2015/core.mjs:4765:60)
at inject (node_modules/@angular/core/fesm2015/core.mjs:4858:12)
at new SomeBaseService (path/to/lib/src/lib/services/base-service.ts:17:78)
at new ConcreteService (path/to/lib/src/lib/services/concrete-service.ts:17:5)
Please provide the environment you discovered this bug in
The text was updated successfully, but these errors were encountered:
deKaantje
changed the title
Error: NG0203 when using inject in abstract base class member
Error: NG0203 when using inject() in abstract base class member
Dec 9, 2022
Is this a regression?
No
Description
I have a abstract base class with a member implementation that uses Angular 14+ inject() method to get the value for an injection token;
This throws an error when using with Spectator :
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in
Anything else?
nope.
Do you want to create a pull request?
No
The text was updated successfully, but these errors were encountered: