feat(compiler): enabled strict checking of parameters to an @Injectable
(#19412)
Added the compiler options `strictInjectionParameters` that defaults to `false`. If enabled the compiler will report errors for parameters of an `@Injectable` that cannot be determined instead of generating a warning. This is planned to be switched to default to `true` for Angular 6.0.
This commit is contained in:

committed by
Victor Berchet

parent
a75040d0a1
commit
dfb8d21ef4
@ -69,6 +69,7 @@ export function createAotCompiler(compilerHost: AotCompilerHost, options: AotCom
|
||||
enableLegacyTemplate: options.enableLegacyTemplate === true,
|
||||
missingTranslation: options.missingTranslation,
|
||||
preserveWhitespaces: options.preserveWhitespaces,
|
||||
strictInjectionParameters: options.strictInjectionParameters,
|
||||
});
|
||||
const normalizer = new DirectiveNormalizer(
|
||||
{get: (url: string) => compilerHost.loadResource(url)}, urlResolver, htmlParser, config);
|
||||
|
@ -19,4 +19,5 @@ export interface AotCompilerOptions {
|
||||
preserveWhitespaces?: boolean;
|
||||
fullTemplateTypeCheck?: boolean;
|
||||
allowEmptyCodegenFiles?: boolean;
|
||||
strictInjectionParameters?: boolean;
|
||||
}
|
||||
|
Reference in New Issue
Block a user