I have this JSON
[
{
Id: "14",
Title: "HR Europe",
Description: "HR Europe",
Color: "3B23FF",
Contents: [
{
Id: "15",
Title: "W.I.D.E Experience",
Description: "Discover our Value!",
Date: new Date('2019-12-02'),
Type: "content",
},
{
Id: "17",
Title: Experience",
Description: "Discover our Value!",
Date: new Date('2019-12-02'),
Type: "content",
}
]
},
{
Id: "12",
Title: "Company",
Description: "Company",
Color: "4FFF26",
Contents: [
{
Id: "13",
Title: "CEO & Presidents Environmental Message",
Description: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
Date: new Date('2020-02-13'),
Type: "content",
}
]
},
{
Id: "8",
Title: "Engine",
Description: "Engine",
Color: "FF4F0C",
Contents: [
{
Id: "10",
Title: "Pre Bunker Training",
Description: "yyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
Date: new Date('2019-12-02'),
Type: "content",
},
{
Id: "11",
Title: "Exhaust Gas Cleaning System pH-Sensor cleaning",
Description: "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu",
Date: new Date('2019-12-02'),
Type: "content",
}
]
I want to show this title Title: "CEO & Presidents Environmental Message"
{{item?.Contents.Title}}
but I used not correct and show
Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
Can you share with me any idea how to use *ngFor
in this part?
Contents
property is an array. Either access specific elements directly{{item?.Contents[0].Title}}
or use a nested*ngFor
. – Michael DContents[0]
– A. B*ngFor
. – Michael D