So I have this weird problem (or might just say my logical problem) on how do I loop an item inside angular html, instead of the value of array must be access something like 0 - 1 - 2 by (keys) it doing something like this 2 - 0 - 1
I will just attach stackblitz example here , I dont know why it occurs like this but something is not right. I might thinking it wrong
getDatais super weird. It changes a component variable on the go for every call, and that in turn probably breaks the nested ngFor. What did you expect to be printed on the screen? I would recommend you avoid at all costs functions with side effects being called from the HTML. You're just inviting trouble and complications to your program.arrayCboxvariable that is, in a sense, global to your component. However, every call togetDatawill alter thatarrayCbox- and there's no way to guarantee that you'll have the correctarrayCboxfor each inner loop of yourngFors. Instead, you should have some way to build yourarrayCboxfor each different element ofsomeObjectArray. Maybe if you show us what problem you are trying to solve, we can figure out a different way to approach it.