Skip to content

Commit

Permalink
Merge branch 'master' of github.com:deepkit/deepkit-framework
Browse files Browse the repository at this point in the history
  • Loading branch information
marcj committed Mar 12, 2024
2 parents 332b26e + eb92e58 commit b5fa0ad
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 @@ -251,7 +251,7 @@ export class Injector implements InjectorInterface {
throw new Error(`Invalid get<T> argument given ${token}`);
}

set<T>(token: T, value: any, scope?: Scope): void {
set(token: ContainerToken, value: any, scope?: Scope): void {
if (!this.setter) throw new Error('Injector was not built');
this.setter(token, value, scope);
}
Expand Down Expand Up @@ -915,7 +915,11 @@ export class InjectorContext {
}

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

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

0 comments on commit b5fa0ad

Please sign in to comment.