feat(ivy): support injecting the injector (#26699)

PR Close #26699
This commit is contained in:
Kara Erickson
2018-10-23 14:28:15 -07:00
committed by Matias Niemelä
parent d5cbcef0ea
commit 2c7386c961
31 changed files with 305 additions and 217 deletions

View File

@ -64,18 +64,6 @@ export function getConstructorDependencies(
ErrorCode.PARAM_MISSING_TOKEN, param.nameNode,
`No suitable token for parameter ${param.name || idx} of class ${clazz.name!.text}`);
}
if (ts.isIdentifier(tokenExpr)) {
const importedSymbol = reflector.getImportOfIdentifier(tokenExpr);
if (importedSymbol !== null && importedSymbol.from === '@angular/core') {
switch (importedSymbol.name) {
case 'Injector':
resolved = R3ResolvedDependencyType.Injector;
break;
default:
// Leave as a Token or Attribute.
}
}
}
const token = new WrappedNodeExpr(tokenExpr);
useType.push({token, optional, self, skipSelf, host, resolved});
});