My code is like that :
this.service.getBusinessCtxValuesFromBizCtx(this.bizCtx.bizCtxId)
.subscribe(values => {
values.forEach(value => {
this.service.getSimpleContextSchemeByCtxSchemeValuesId(value.ctxSchemeValueId)
.subscribe(scheme => {
console.log('Name of the Scheme : ' + scheme.schemeName);
});
});
});
Here is my issue :
The first service ID = 3
retrieves a list ID = 189, 12 and 18
, I get the complete list with the correct information on picture.
However on the forEach
, only the first element of the list is retrieved, the rest is null
.
I can't find the reason behind this weird behavior.
schemes
array even though there are more elements in the array? – Koushik Ravulapelli Feb 22 '19 at 16:28forEach
? Or else can you create SlackBlitz. Moreover, you are facing this issue because ofasync
nature. – Yashwardhan Pauranik Feb 22 '19 at 16:28