Skip to content

Commit

Permalink
feat(injector): improve injector context set method api
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-sa committed Mar 7, 2024
1 parent 14a4c9f commit 901bd24
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/injector/src/injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,12 @@ export class InjectorContext {
return this.getInjector(module || this.rootModule).instantiationCount(token, this.scope ? this.scope.name : scope);
}

set(token: ContainerToken, value: any, module?: InjectorModule): void {
return this.getInjector(module || this.rootModule).set(token, value, this.scope);
set<T>(token: T, value: any, module?: InjectorModule): void {
return this.getInjector(module || this.rootModule).set(
getContainerToken(token),
value,
this.scope,
);
}

static forProviders(providers: ProviderWithScope[]) {
Expand Down

0 comments on commit 901bd24

Please sign in to comment.