As per my requirement, I need to send async request using the Angular 6 Httpclient.
Can anyone explain howe can send async request?
Loop calling in Component:
function in REST API service:
Right now, all request is going all together. But I want that after complete first request request 2nd should go and so all.
Please let me know is this possible in Angular 6?
Please try to provide me some good example.
this.pressArray.forEach(function(field_value, field_index){
restAPI.CallAddPageBlock(formData, '', id).subscribe(response2 => {
content_blocks.push(response2.id);
});
});
CallAddPageBlock(formData, tickets='', id): Observable<any> {
var full_url = this.baseUrlContent + 'Hub_PageBlock_C/assets/';
if(id!=0){
full_url = full_url+id
}
return this.http.post(full_url, formData, this.httpOptionsJson).pipe();
}