Better way to add HTTP auth headers from SqlStorage?

I had my question answered here:

By replacing my HTTPClient get function with this:

get(url) {
    return Observable
        .fromPromise(this.buildHeaders())
        .switchMap((headers) => this.http.get(url, { headers: headers }));
}

It returns an Observable, so it functions just like the Angular HTTP object. However, I’m still not sure if there is a better way to do auth headers…

2 Likes