【发布时间】:2019-10-03 00:13:24
【问题描述】:
我想在角度 6 中发送同步请求这个嵌套的 for 循环。所有的 for 循环都必须等待对方的响应。请在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
})
}
}
}
}
}
}
}
}
【问题讨论】:
-
到目前为止你尝试了什么?
-
请不要在您的帖子中添加随机垃圾以绕过 SE 质量限制。相反,添加实际细节。另见How to Ask
标签: javascript angular synchronization angular6