How to pass a parameter(logged user) to all the ionic pages


I want to pass user name to all the pages… Please help me


Hi @Velmurugan,

You can create a service to store the username and other data there, and access to it from the pages that need it. Check out this tutorial on services:



Thanks… Romerio…


No problem! By the way, my name is Rodrigo :sweat_smile:

1 Like

one small doubt. Suppose if i am not using the server side code , how i will send my logged user_name to my provider .

this is the code i have seen in provider,

    return this.http.get('').map(res => res.json());


In my case , 
1.First time the login screen will open  with otp. then go to Home page..

2.Second time directly go to home page




constructor (){
this.logged_user = this.navParams.get('logged_user');           // second time this will return null

  public async get_user() {
    if (logged_user !== undefined) {
      console.log('User is already set.');
    this.logged_user = await'username');  //second time will get the data from here

    console.log(this.logged_user, ' is already  loggedin home screen ');