I'm building an app where users have to login on a certain subdomain. That's different for every user. So on the login page the user logged in whit subdomain, username and password. Before doing api calls I have to save the subdomain in the ionic storage. That's no problem but how I'll use that subdomain as a const in my api service because it's a async it doen't give the value right away.

This is my function in the service

```
startFunction(entry) {
    this.storage.get('subdomain').then(
        result => {
            return this.http.post(result + this.apiUrl, JSON.stringify(entry), { headers: HEADER.headers}
            );
        }
    )

}

```

and this my page component

```
otherFunction(){
    this.GetApi.startFunction(entry).subscribe(
    result => {
        console.log(result)
    },
    err => {
        console.log(err);
    });
}

```

But this gives an error `cannot subscribe to undefined`, how to use the async storage value in a promise/observable. Best would be a sort of const that I can use for every function in the api service.