Skip to content

Instantly share code, notes, and snippets.

@alexzuza
Last active March 20, 2018 14:04
Show Gist options
  • Save alexzuza/45cca0ae3cada053315382f85c199109 to your computer and use it in GitHub Desktop.
Save alexzuza/45cca0ae3cada053315382f85c199109 to your computer and use it in GitHub Desktop.
DI merge injector signature
class Injector_ implements Injector {
constructor(private view: ViewData, private elDef: NodeDef|null) {}
get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {
const allowPrivateServices =
this.elDef ? (this.elDef.flags & NodeFlags.ComponentView) !== 0 : false;
return Services.resolveDep(
this.view, this.elDef, allowPrivateServices,
{flags: DepFlags.None, token, tokenKey: tokenKey(token)}, notFoundValue);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment