angular - Making Components Available to Nested Modules -


so right have set looks this:

  • app module
    • a large module
      • another large module
        • a component

a component not have access components loaded in a large module, though components defined both declarations and exports of a large module.

is there way can give nested module another large module access component imports of a large module it's child components have access components? or these need declared inside another large module in order it's child components have access them?

you need import things in module if components declared in use things. can create feature module imports/exports/declares set of components , use in other modules.

- app module    - featurea module    - featureb module    - large module (import featurea module)        - component [can use components featurea;                      can't use components featureb]        - large module (import featurea module, featureb module)            - component [can use components featurea , featureb] 

if large module , another large module lazy loaded, have featurea module in both files/packages, few kilobytes won't hurt. 1 benefit reusability, can use feature modules in other projects:

- different app module    - featurea module    - featureb module    - different large module (import featurea module)        - component [can use components featurea;                      can't use components featureb] 

Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -