Ionic-framework: using multiple pages as one module

Created on 11 Nov 2018  路  7Comments  路  Source: ionic-team/ionic-framework

how can i have multiple pages as one module?

For example, if I have 2 pages: first page shows all users as a list and the second one shows the user's details which has been selected.
these two pages perform as one component called _user-page_ and also share common functions and variables.

using Ionic v1, I could use one controller in multiple pages of html. how can i have structure like this in Ionic v3?
i also care about the code being well-structured and clean.

@jgw96 posted in https://github.com/ionic-team/ionic/issues/12333# :

The next version of generators, which is coming out soon, is going to make it optional to add a separate module for each page, therefore allowing you to customize it however you would like it. Thanks for using Ionic!

any news??

v3

All 7 comments

This is something that can be done in v4.

This is something that can be done in v4.

Can you help me how? I would appreciate If it's possible to send a link to a tutorial.

If you need it with Ionic 3, please use the v3 repository (https://github.com/ionic-team/ionic-v3). This issues are v4 only!

As @dylanvdmerwe said using Ionic 4 is no problem because it uses Angular Router and there you have all this possibilities -> https://angular.io/guide/lazy-loading-ngmodules

I think this is something that should be moved to the forums. However a v4 app is just an Angular app. Modules behave exactly as they do with any Angular app in v4.

As such, you define the routes in the module and then declare in the module's declarations the pages/components you want to include in the module.

Thanks you very much. I can fix my problem using ionic v4馃憣馃徏

This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.

If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know!

Thank you for using Ionic!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

masimplo picture masimplo  路  3Comments

fdnhkj picture fdnhkj  路  3Comments

brandyscarney picture brandyscarney  路  3Comments

alexbainbridge picture alexbainbridge  路  3Comments

BilelKrichen picture BilelKrichen  路  3Comments