Issue to access to app.component from other ts files

Hi brothers, i’m using ionic 3, i have a issue i don’t know how to access to MyApp from the other pages ts, for exemple i want to define a var in app.component so i need to manupulate this var from an other pages ts, how can i do that helo me plz

I think you can’t just ‘access’ variables of other pages.
Maybe NavParams can do the job.
Read the docs.

1 Like

Set up a directory called helpers and create a helper file called global-helper.ts…

export module GlobalHelper {
   export function someNumber(){ return 113; }
}

You can import and use that file anywhere without needing to put it into a module.

Obviously if the app.component is going to update a value you can put a function in there to update a local variable.

1 Like

i did it by another way i used events :))) thnks a lot brother

For the sake of others you should post what you did.

Marking your own sentence as ‘Solution’ with nothing to back it up is a little rude - you have an opportunity to help others here.