Closed spotlesscoder closed 1 year ago
actually, that code works as expected.
since that MyClassA
provider is annotated with @Injectable()
, MyClassA
is said injectable, which means that we can inject providers into ti. It is not the other away around, as you said. MyClassB
didn't has dependencies so it doesn't need to be marked as a injectable.
We don't have to add the @Injectable()
to a class unless we want to inject something in that class, or if that class is using the @Inject()
parameter decorator.
if you don't believe me :p
@darraghoriordan I think you can close this :)
Consider the following classes
Note that class B is not injectable. In the constructor line in class A, I want the eslint check to highlight that the myInstanceB cannot be instantiated because MyClassB is not injectable