bitwarden-estensione-browser/libs/angular/src/components/modal/modal-injector.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
476 B
TypeScript
Raw Normal View History

2021-12-16 13:36:21 +01:00
import { InjectFlags, InjectionToken, Injector, Type } from "@angular/core";
export class ModalInjector implements Injector {
2021-12-16 13:36:21 +01:00
constructor(private _parentInjector: Injector, private _additionalTokens: WeakMap<any, any>) {}
2021-12-16 13:36:21 +01:00
get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): T;
get(token: any, notFoundValue?: any, flags?: any) {
return this._additionalTokens.get(token) ?? this._parentInjector.get<any>(token, notFoundValue);
}
}