New page Created Module.ts file


#1

Hi Everyone.

I’ve an issue. When I run ionic page command in ionic 2 blank project to create a new its creates 4 files.
For example if i run ionic g page about it makes a about folder containing 4 files
about.html
about.scss
about.ts
and the last one about.module.ts

Please guide me why this about.module.ts is being created

Thanks


Problem with "declarations of 2 modules"
#2

Unless you have a solid understanding of what it is doing, I recommend simply deleting it.


#3

Well… I did it already. But I’m supersized why Its been created.


#4

I have the same problem , also in app.module.ts couldn’t find the page that I created it


#5

Well For That You Have to manually add the page in app.module.ts… A


#6

Hi, @mk0547

Could you try

ionic genrate page “pagename”

Hope this will work for you. If you find it helpful then you can mark it as a solution. You can always like the answer by clicking on heart icon.


#7

That file is for ionic 3


#8

@williamdelvalle Thanks for replying. Can you please guide me about it more. coz my project is in ionic 2. and I’m not understanding its relation with ionic 3


#9

@mk0547 Show me the result of the ionic info command


#10

I have the same problem The project is created with version 2. I have another project created last week and with the same function does not happen. It only happens with the creation of a new project. Thanks


#11

@williamdelvalle Please see… and guide Thanks

Cordova CLI: Not installed
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 8.1
Node Version: v6.10.0
Xcode version: Not installed

One thing is surprized for me in it I’ve installed cordova if run cordova -v its telling me cordova version 6.5.0 but ionic info says Cordova CLI not installed


#12

You could reinstall cordova again and try again please.

npm install -g cordova


#13

You can ignore the module.ts files.


#14

I’m not so sure about that. You have to decide whether you want in on the lazy page loading or not, and if you leave them there they will opt you in. Unless you’re convinced that it’s going to have a net beneficial impact, my current position is that it’s best to delete that file and remove the IonicPageModule decorator from pages.


#15

@rapropos Agreed. For example, I’m in the middle of fully porting my project over to the latest Ionic code base and will be doing performance testing to see if all on only certain pages warrant lazy loading. Until that testing is done I can’t just generalise or simply ignore certain features / code.


#16

In my experience, Angular 4 and ionic-native 3 on their own offer significant bundle size reductions (and corresponding startup time minimization). Lazy page loading, OTOH, is a rather mixed bag at the moment.


#17

I’m sure there’s a compromise vs, balance vs. benefit at the moment. I’m sure it’ll all even out in the end. We just need to make intelligent, informed decisions on when to use which features as well as thoughtful application structure / design decisions. This can take time but I’ve found it’s saved me more time in the long run than it’s cost me.


#18

I think a viable heuristic at the moment is as follows:

If all of your pages are truly completely independent of one another and the primary landing page is relatively light, lazy page loading might be worth looking into. If you have custom components that are shared by multiple pages or your landing page is relatively heavy compared to your other pages, it’s probably not recommended.


#19

@williamdelvalle I did what you said and it works well, many thanks :slight_smile:


#20

@mk0547 for more explanation, previously we add the page to app.module.ts, and import it when we need to navigate to it from some page… in ionic 3 you don’t need to do that even if your app is use ionic 2 you could just navigate to ionic 3 page by putting the page name as string like this
this.navCtrl.push(‘Registration’); // Registration is my new page using ionic 3 generated page

try to update cordova as @williamdelvalle said… it does work after updating cordova