You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.
Yeah, that doesn't sound very intuitive. The application injector is creating the Outer component, but that job should be left only to the directive injectors.
In fact I would argue that instead of passing in null, we should throw, i.e. all injector dependencies are hard, not optional.
A dirty way to achieve that would be to add NgElement as a constructor dependency, which can only be resolved by the directive injector.
I tried to point out the same issue a couple of days ago (less clear than you did though). I agree that it is really confusing. Registering directives in the injector is wrong because we don't want a default instance of components to be created. Hard injector dependencies would also be better imo. Otherwise, you might get hard-to-debug NPEs now and then.
I have two components:
When the InnerComponent is created I expect it to get 'null' value if OuterComponent is not present as its parent, but it's not the case.
Here's a failing test:
The text was updated successfully, but these errors were encountered: