Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Ionic CLI make module files?

When using latest Ionic CLI, its making module files. Why does it make a module file? Also, how do I properly register this module? What is the benefit of having a tab or page generated with a module file vs without? For example, when installing tabs default project(ionic start myApp tabs) you don't get tabs with module files, and with the generator you do.

like image 899
alphapilgrim Avatar asked Jan 03 '23 01:01

alphapilgrim


1 Answers

The purpose of the module files is lazy loading. You don't need to register it. It is a self-contained module file for the particular page.But if you don't need lazy loading then you can use this CLI for generating pages.

ionic generate page MyPage --no-module

Note: I highly suggest you to use Lazy loading. It'll give huge performance boost to your app.

Here you can read more about lazy loading.

like image 106
Sampath Avatar answered Jan 05 '23 16:01

Sampath