import { Injector } from '@angular/core'; export class PortalInjector implements Injector { constructor( private readonly parentInjector: Injector, private readonly customTokens: WeakMap ) {} get(token: any, notFoundValue?: any): any { return this.customTokens.get(token) || this.parentInjector.get(token, notFoundValue); } }