Service is injectable without Injectable decorator #12098
I'm submitting a ... (check one with "x")
The documentation of Injectable says:
The CLI also adds Injectable to all the services it creates, and the tutorial explains that a service must have this annotation.
However, a simple experiment with a component using a service not annotated with Injectable works fine (see http://plnkr.co/edit/IJVf79C1D8bNVLg9Kh2f?p=preview for example). It seems that the Injectable annotation is actually only needed if the service itself has dependencies that must be injected in its constructor, but that doesn't match with what the documentation says.
angular should throw an error when an injector is trying to create an instance of a service not decorated with Injectable. Or the documentation should be fixed to explain what Injectable really is for.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked due to inactivity.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.