I am working with an array of strings and trying to call an async function on each string. However, when using a for loop, the subscribe function does not execute. Is there a more appropriate method for achieving this task? Below is my current implementation:
for (let i = 0; i < this.selectedNodes.length; i++) {
this.fileSelectorService.fixPath(this.selectedNodes[i])
.subscribe(res => {
// The code inside this block doesn't run when using a for loop (works fine without it)
var fixedPath = res;
})
}
}