From my firebase database, I get this JSON data
categories= [
{
"laptops" : [ null,
{
"category" : "laptops",
"description" : "ggg",
"title" : "Nexus" <-- I want this value but i canot do that pls help me
},
{
"category" : "laptops",
"description" : "nnn",
"title" : "HP"
},
{
"category" : "laptops",
"description" : "mmm",
"title" : "Microsoft"
},
{
"category" : "laptops",
"description" : "mmm",
"title" : "Razer"
}
],
},
{
"tablets" : [ null,
{
"category" : "tablets",
"description" : "uuu",
"title" : "Iphone"
},
{
"category" : "tablets",
"description" : "bbb",
"title" : "Intel"
}
]
}
]
In my app.component.html
<div *ngFor="let category of categories; let i = index;" id="{{category.$key}}">
</div>
and is give me -> laptops and tablets
all is ok but how I can't get the title of category -> tablet
I have this code but is not working I get [object Object]
and I want to get ->
<div *ngFor="let category0 of categorys; let i = index;" id="{{category0.$key}}">
<div>{{i}}</div>
<div *ngFor="let category1 of category0[i]; let ii = index;">
{{category1}}
<div>{{ii}}</div>
<div *ngFor="let category2 of category1[ii]; let iii = index;">
{{category2.title}}
<div>{{iii}}</div>
</div>
</div>
</div>
this is the output
0 [object Object] 1 [object Object] 2 [object Object] 3 [object Object] 4
and this is the error on console
AdminProductsComponent.html:92 ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
at NgForOf.ngOnChanges (common.es5.js:1689)
at checkAndUpdateDirectiveInline (core.es5.js:10790)
at checkAndUpdateNodeInline (core.es5.js:12216)
at checkAndUpdateNode (core.es5.js:12155)
at debugCheckAndUpdateNode (core.es5.js:12858)
at debugCheckDirectivesFn (core.es5.js:12799)
at Object.eval [as updateDirectives] (AdminProductsComponent.html:92)
at Object.debugUpdateDirectives [as updateDirectives] (core.es5.js:12784)
at checkAndUpdateView (core.es5.js:12122)
at callViewAction (core.es5.js:12485)