ngx-rocket / generator-ngx-rocket

:rocket: Extensible Angular 14+ enterprise-grade project generator
https://ngx-rocket.github.io/
MIT License
1.53k stars 216 forks source link

Why is the Core Module imported by the Home Module? #560

Closed ykoitzsch closed 4 years ago

ykoitzsch commented 4 years ago

538 I'm submitting a...

Current behavior

Core Module is imported by the Home Module aswell by the App Module.

Expected behavior

Core Module is only imported by the App Module

Others: I am curious why the Home Module needs to import the Core Module when it's already being imported by the App Module? The following line in the CoreModule is also not being triggered:

`throw new Error(`${parentModule} has already been loaded. Import Core module in the AppModule only.`);`

What am I missing here? :)

sinedied commented 4 years ago

Thanks for pointing this out, this is most likely code legacy from the early version that was forgotten to clean up (oups). Due to how all provided were migrated to the new providedIn syntax it's harmless, I'm not entirely sure why the error is not thrown but I guess due to how module dependency work it's smart enough to not try instanciating the module twice as it's already in the parent module (AppModule). I think making the home module lazy would most likely trigger the error though.

Anyways, thanks for the catch! Would you like to propose a PR to remove it?

sinedied commented 4 years ago

:tada: This issue has been resolved in version 9.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: