feat(core): make new Inject() optional for deps specified as InjectionToken (#14486)

fixes #10625
This commit is contained in:
Victor Berchet
2017-02-20 16:20:45 -08:00
committed by GitHub
parent 5f3c8441e4
commit d6a58f9f70
6 changed files with 41 additions and 29 deletions

View File

@ -825,6 +825,8 @@ export class CompileMetadataResolver {
token = paramEntry.attributeName;
} else if (paramEntry instanceof Inject) {
token = paramEntry.token;
} else if (paramEntry instanceof InjectionToken) {
token = paramEntry;
} else if (isValidType(paramEntry) && token == null) {
token = paramEntry;
}