Trying to http post items of an array one after another in sequence. Knowing should use RxJS flatMap but couldn't make it work. Basically I need something like this:
item is an element of an array named items, want to go through the array and send each item.
this.http.post(url, item)
.subscribe(
(response) => {
// call the same http.post again to send the next item
},
(error) => {
this.app.error(error.json() as Error); // exit
}
)
Thanks for the help.