I am trying to get the token that I stored using the ionic storage and store it in a global variable `public token = ''`. But every time I access it using `this.token` the value doesn't change.

```
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Storage } from '@ionic/storage';

const TOKEN_KEY = 'access_token';

@Injectable()
export class ContactProvider {

  public url = 'myapi-link';
  public token = '';

  constructor(
    private storage: Storage,
    private http: HttpClient
  ) {

  }

  loadToken(){

    this.storage.get(TOKEN_KEY).then((token)=>{
      this.token = token;
      console.log(this.token);
    });

  }

  setHeaders(default_content_type = 'application/json'){

    let headers = new HttpHeaders();
    headers = headers.set('Content-Type', default_content_type)
    .set('Authorization', 'Bearer ' + this.token)
    return headers;

  }

  getData(type){

    this.loadToken();
    let headers = this.setHeaders();
    return this.http.get(this.url + type, {headers: headers});

  }

}

```

when calling the `this.setHeaders()`, the `this.token` does not change.