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:
Chuck Jazdzewski
2017-09-26 13:40:47 -07:00
committed by Victor Berchet
parent a75040d0a1
commit dfb8d21ef4
6 changed files with 37 additions and 5 deletions

View File

@ -52,6 +52,14 @@ export interface CompilerOptions extends ts.CompilerOptions {
// Don't produce .ngfactory.ts or .ngstyle.ts files
skipTemplateCodegen?: boolean;
// Always report errors when the type of a parameter supplied whose injection type cannot
// be determined. When this value option is not provided or is `false`, constructor
// parameters of classes marked with `@Injectable` whose type cannot be resolved will
// produce a warning. With this option `true`, they produce an error. When this option is
// not provided is treated as if it were `false`. In Angular 6.0, if this option is not
// provided, it will be treated as `true`.
strictInjectionParameters?: boolean;
// Whether to generate a flat module index of the given name and the corresponding
// flat module metadata. This option is intended to be used when creating flat
// modules similar to how `@angular/core` and `@angular/common` are packaged.