App Structure Problem: redundant module import
kdhttps opened this issue · 0 comments
Problem
I found one structure problem. I've to import third-party modules at multiple places. If I want to use third-party components at header.component.ts
and home.component.ts
then I've to import it at two places one at app.module.ts
and shared.module.ts
.
For example
I am using ngx-spinner
lib. If I want to use <ngx-spinner>
in the header.componnet.ts
then I am importing NgxSpinnerModule
in app.module.js
, here is ok.
But if I want to use <ngx-spinner>
in any other page like in home.component.ts
(except header and footer page) then I again need to import NgxSpinnerModule
in shared.module.ts
.
I am using one more third-party lib that is angular-fontawesome
here it again creating a problem. I've to import it in two places.
IMO, This is not good for code maintenance. here is one simple solution, need to exports all the modules from shared.module.ts
. I've fixed the problem let me know your thought, I would like to contribute and make Pull Request.