So functions that use the RxJS .post().map() etc will return Observable
getNumber(): Observable
var observable = Observable.create((observer: Observer
observer.next(10);
observer.complete();
});
return observable;
}
It can then be consumed, along with other promise-style functions and dealt with like promise.all()
Observable.forkJoin([
this.dataService.getNumber(),
this.dataService.getSomethingElse()
]).subscribe(results => {
this.number = results[0];
this.somethingElse = results[1];
});
Using the subscribe is like using promise.all()
Feels a bit weird at first, but basically if you want to return a promise of a simple type, just create a function like the getNumber() function above.