How to receive 2 param from different pages in ionic 4

Hi , I’m havin an issues on passing 2 data from different page to main page called ‘mainex’

I’m using ionic 4 and angular 5

app-routing-module

here is my main page that i want 2 param to meet

{

    path: 'mainex',

    loadChildren: () => import('./exmenu/mainex/mainex.module').then( m => m.MainexPageModule)

  },

here is my two pages that i need the parameters to pass into the mainex

{

    path: 'exf7q4/:emark3',

    loadChildren: () => import('./exmenu/exf7q4/exf7q4.module').then( m => m.Exf7q4PageModule)

  },
{

    path: 'exf8q8/:emarks7',

    loadChildren: () => import('./exmenu/exf8q8/exf8q8.module').then( m => m.Exf8q8PageModule)

  },

what should i do? i’m confused.

Why don’t you just have a shared service, set the data on the service in your main page, transition to your next page in code and retrieve the data from the service?

1 Like


the totalresult calculation at mainex.

sorry for my bad drawing. this is the flow that i’m going to do. but i’m kinda stuck at this. still new with ionic angular . do you mean that i need to declare variables for each pages in a service and then retrieve it ?