I have a modal popup, which I am coding such that when an open()
function is called, it returns an observable. Any subscriber will then get an object with a property indicating what button was pressed in the modal or whether it was closed, etc.
If a 'success' button is pressed, I want to make a http call, which in turn also returns an observable! How would I combine these two observables? In angular 1 with promises I can return promises from promises, so I would do something like
var promise = modal.open()
.then(function(res) {
if (res.success) {
return httpService.get(); // also returns a promise
}
return res;
});
how would I do something like this for observables?