fix(compiler): recognize @NgModule with a redundant @Injectable (#20320)

The compiler now, again, recognizes `@NgModule()` decorators on
classes with a redundant `@Injectable()` decorator.

Fixes: #19544

PR Close #20320
This commit is contained in:
Chuck Jazdzewski
2017-11-09 16:52:19 -08:00
committed by Jason Aden
parent cf618c564c
commit c33a57666b
2 changed files with 40 additions and 4 deletions

View File

@ -709,15 +709,15 @@ export function analyzeFile(
} else if (metadataResolver.isPipe(symbol)) {
isNgSymbol = true;
pipes.push(symbol);
} else if (metadataResolver.isInjectable(symbol)) {
isNgSymbol = true;
injectables.push(symbol);
} else {
} else if (metadataResolver.isNgModule(symbol)) {
const ngModule = metadataResolver.getNgModuleMetadata(symbol, false);
if (ngModule) {
isNgSymbol = true;
ngModules.push(ngModule);
}
} else if (metadataResolver.isInjectable(symbol)) {
isNgSymbol = true;
injectables.push(symbol);
}
}
if (!isNgSymbol) {