1

Ionic 4 : why every page generate command creates module file and there is no cli command for generate only modules for better abstraction.

I know the difference between modules and components. modules used for lazy loading so it can load only whenever it requested only, But my question is does it required to generate module for every single page?

Ionic 4 CLI doesn't provide generate commands for custom modules like angular does.

what if i do have some static information pages which doesn't required lazy loading (separate modules for every page) for these scenario which one is the best way (for performance of the application).

-> To create a custom module manually and create components of pages OR -> Use ionic4 cli and use generate page command

paras shah
  • 861
  • 2
  • 9
  • 23
  • you can use angular cli to generate modules 'ng g module yourModule' also as I understand you should follow [angular conventions](https://angular.io/guide/styleguide) during structure your app as ionic now is not based on angular as was in older versions – Karim Ahmed Mar 27 '19 at 18:24
  • Thanks for your time @karimAhmed. My question is do we need to use module for every mobile page? or with we can use just component which one is best for mobile browser – paras shah Mar 28 '19 at 05:21
  • I think it'll give you a better performance when each page is a lazy-loaded module. please read [this blog](https://blog.ionicframework.com/how-to-lazy-load-in-ionic-angular/) – Karim Ahmed Mar 28 '19 at 07:43
  • Ok, Thanks for the time @KarimAhmed – paras shah Mar 29 '19 at 13:46

0 Answers0