0

How modules are distributed on components. and what are the advantages of this new concept over simple folder organisation ?

Options:

  • One module per component ?
  • One module per page.
  • Other ...
Mistalis
  • 17,793
  • 13
  • 73
  • 97
user2080105
  • 1,642
  • 4
  • 18
  • 27

1 Answers1

0

Components, directives, pipes, and services should be grouped together per feature. If they are usually (re)used together, they should be in the same module.

A module can be lazy loaded. If you want a part of your application to be lazy loaded, then put the components, ..., that build that part of your application in such a module, or import modules that contain the components, ..., only from such a lazy loaded module.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • but I find myself obliged to create a module per component to be able to export them to be used for parent components ! – user2080105 Jan 18 '17 at 09:31