getProblems(): Observable<Problem[]> {
this.httpClient.get('api/v1/problems')
.toPromise()
.then((res: any) => {
// .next: next data
this._problemSourse.next(res);
})
.catch(this.handleError);
return this._problemSource.asObservable();
}
if we don't use promise, how do we achieve the same functionality
Aucun commentaire:
Enregistrer un commentaire