projects/commons/src/lib/shared/portal/portal-injector.ts
Methods |
constructor(parentInjector: Injector, customTokens: WeakMap
|
|||||||||
|
Parameters :
|
| get |
get(token: any, notFoundValue?: any)
|
|
Returns :
any
|
import { Injector } from '@angular/core';
export class PortalInjector implements Injector {
constructor(
private readonly parentInjector: Injector,
private readonly customTokens: WeakMap<any, any>
) {}
get(token: any, notFoundValue?: any): any {
return this.customTokens.get(token) || this.parentInjector.get<any>(token, notFoundValue);
}
}