1

According to John Papa's tutorial, he uses the directives attribute inside of @component when depending on another component. Apparently, directives has been removed in RC6 and the alternative is to use it inside of @ngModule in declarations.

Is there another alternative that could allow us to nest components without needed to include all of them inside of @ngModule?

https://github.com/angular/angular/commit/4a740f2

1 Answer 1

1

No, @NgModule() is the way to go since RC6 and there are no alternatives.

There was quite some discussion but I haven't seen any serious arguments why this would be needed.

Sign up to request clarification or add additional context in comments.

4 Comments

well i haven't heard of it. it might be cleaner, but this really closes some possibilities of writing the code. having the hierarchy of cascading imports has it's benefits. i guess it's not too bad though.
What possibilities are closed?
being able to just import one component in @ngModule instead of including all of that one component and it's subcomponents.
You just need to think a bit more how you distribute your components and directives to modules. They designed it that way to make it work with lazy loading in combination with the router.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.