Want to improve this question? Add details and clarify the problem by editing this post.
Closed 12 months ago.
i want to send synchrouns request this nested for loop in angular 6. it all for loop must wait each other response. Please give some example in https://stackblitz.com
protected plateInfo(debug = true) {
for (let i = 0; i < 8; i++) {
for (let k = 0; k < 8; k++) {
if (k % 2 !== 0) {
for (let threshBlock = 21; threshBlock < 31; threshBlock++) {
if (threshBlock % 2 !== 0) {
for (let treshWeight = 5; treshWeight < 19; treshWeight++) {
if (treshWeight % 2 !== 0) {
this.getPLateInfo.getInfoPlate({
qausLast: i,
qausParam: k,
treshBlock: threshBlock,
treshWeight: treshWeight
}).subscribe(_data => {
this.result.push(_data)
_data.input1 = i
_data.input2 = k
})
}
}
}
}
}
}
}
}