Provides a class instance for a token via a class constructor.
Optional
Readonly
An optional name to qualify this provider. If specified, the token must be resolved using the same name.
Equivalent to decorating the class with @Named(...).
@Named(...)
export class ExtensionContext { // Decorator-based injection constructor(@Inject(ISecretStorage) @Named("persistent") secretStorage: SecretStorage) {} // Function-based injection constructor(secretStorage = inject(ISecretStorage, "persistent")) {}} Copy
export class ExtensionContext { // Decorator-based injection constructor(@Inject(ISecretStorage) @Named("persistent") secretStorage: SecretStorage) {} // Function-based injection constructor(secretStorage = inject(ISecretStorage, "persistent")) {}}
The class to instantiate for the token.
Provides a class instance for a token via a class constructor.