New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(compiler): enabled strict checking of parameters to an `@Injectable` #19412

Merged
merged 1 commit into from Sep 26, 2017

Conversation

Projects
None yet
5 participants
@chuckjaz
Member

chuckjaz commented Sep 26, 2017

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.

PR Type

What kind of change does this PR introduce?

[x] Feature

What is the current behavior?

The compiler will always emit a warning when a parameter of an @Injectable class cannot be resolved. This can often lead to them being undiscovered and causing issues that are only discovered at runtime.

What is the new behavior?

The new compiler flag strictInjectionParameters allows turning these warnings into errors.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@googlebot googlebot added the cla: yes label Sep 26, 2017

@mary-poppins

This comment has been minimized.

Show comment
Hide comment
@mary-poppins

mary-poppins commented Sep 26, 2017

@tbosch

tbosch approved these changes Sep 26, 2017

@chuckjaz chuckjaz changed the title from feat(compiler): enabled strict checking of parameters to an `@Injectble` to feat(compiler): enabled strict checking of parameters to an `@Injectable` Sep 26, 2017

feat(compiler): enabled strict checking of parameters to an `@Injectable
`

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.

@vicb vicb merged commit dfb8d21 into angular:master Sep 26, 2017

3 of 5 checks passed

ci/circleci: lint CircleCI is running your tests
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
ci/circleci: build Your tests passed on CircleCI!
Details
cla/google All necessary CLAs are signed
code-review/pullapprove Approved by all reviewer groups.
Details
@mary-poppins

This comment has been minimized.

Show comment
Hide comment
@mary-poppins

mary-poppins commented Sep 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment