Ionic generate "module" why isn't his a feature on the CLI?


#1

Hello, I come from a angular CLI (angluar 4/5 project) learning Ionic. and I’ve noticed we’re missing a few key things from the Ionic CLI such as generating modules. Is there a reason for this ? I see in the docs Ionic does support modules.

Another comment is that the documentation should show which version of ionic it is for to make sure its clear to the reader these features for for the same version they’re working with.

Thanks in advance to any advice or help!


#2

Neither routing nor lazy loading takes place via modules, so there are some (hidden) fundamental differences between Ionic and Angular projects. The Ionic CLI was designed for developers creating small apps (think less than 10 pages). For large apps or PWA’s, a different approach is needed. One user here is putting together an approach using Angular schematics that he’s made public. I’ve adopted a different approach that I haven’t made public yet, but the key point for me is that I separate out modules with providers from view modules, and I eagerly load the former lazily load the latter.

If you come up with any new great ideas, please let us know. The best practices here is not yet determined, and it may change again depending on what routing looks like in Ionic 4.


#3

Thanks for the reply and pointing out the differences. I’ll start by getting used to the Ionic way before attempting anything complex.The app I have in mind will most likely have under 10 “pages”.


#4

@jessycormier take a look at: