I am learning and get always struggle with same problems. I want to load a list from my json file. The problem is that the json is not like this:
[{ "id":"1"},{ "id":"2"}]
Instead of this I have more complex lists like:
[{"data":[{"id":"1"},{"id":"2"}]}]
and even more rows inside. If I do subscribe in angular like this:
getCustomersList()
.subscribe(
data => {
this.consolelist = data[0].data;
});
I always get output of whole file and have to do ngfor in template, or even sometimes ngfor in ngfor. Isn't it possible to build a new array like new = []; and read only data[0].data inside? How is this handled? Is my thinking wrong and do I always have to build this way, with ngFor in the template?
Are there any tutorials which explain it, or something like this?