At this moment, I am in need of retrieving two elements from my storage, each providing me with a promise. The challenge lies in using these promises to create an HTTP request in Angular 2. Despite numerous attempts, I have been unsuccessful in finding the right approach, always resulting in an
Observable<Observable<Response>>
.
let tokenPromise = this.getToken()
let registrationTokenPromise = this.getRegistrationToken()
Observable.zip(
tokenPromise,
registrationTokenPromise,
(token, registrationToken) => {
let headers = this.headers(token)
return this.http.post(`${this.apiBase}/users/registration-token`,
{ registration_token: registrationToken },
headers
)
})
My query now remains: How can I resolve this issue to successfully obtain an Observable<Response>
?