Dear All,
I am was bulding one component using Angular 5 and ASP .Net MVC with REST API.
My problem is that I have one function with me and I want to call it using for loop.
What i am facing is that though first request is not completed still second function is get called.
In short you can say that I want to make it synchronously.When first function call get completed then and then only second function call should done by using loop.
Please let me know easy solution.
Your solutions are always valueable for me.
Thanking You In Advance.

Mario ScheerenRank #1,371 · 1.2K reputationPosted May 2, 2019, 12:30 AM EDT
result => {
// method1 completed successfully
this._http.post
.subscribe(
result => {
// method2 completed successfully
this._fillForm(result);
},
err => console.error(err), // method2 completed with error
() => { // method2 completed somehow }
);
},
err => console.error(err), // method1 completed with error
() => { // method1 completed somehow }
Mario ScheerenRank #1,371 · 1.2K reputationPosted May 2, 2019, 9:02 AM EDT
async addWithAsync() {
Mandar ShindeRank #4,584 · 336 reputationPosted May 2, 2019, 2:43 AM EDT