I have list of group items which i am getting dynamically below is sample data
groupItems = {
"AllResult": [
{
"GrpId": 1,
"GroupName": "DESKTOP",
},
{
"GrpId": 2,
"GroupName": "LAPTOPS",
},
{
"GrpId": 3,
"GroupName": "MOBILES",
}
]
}
and i am displaying these in the form of buttons so when ever i click on this button the i need display the result of that concerned group suppose if i click the Group name Laptops the items of laptops has to be displayed by using the groupid below is the result of the Items JSON
itemsDetails = {
"AllList": [
{
"ItemId":1
"GrpId": 1,
"ItemName": "DELL",
},
{
"ItemId":1
"GrpId": 1,
"ItemName": "ACER",
},
{
"ItemId":1
"GrpId": 1,
"ItemName": "LENOVO",
},
{
"ItemId":1
"GrpId": 2,
"ItemName": "HP",
},
{
"ItemId":1
"GrpId": 2,
"ItemName": "ASUS",
},
{
"ItemId":1
"GrpId": 3,
"ItemName": "Motorolla",
}
]
}
.html
<div *ngFor="let data of groupItems" (click)=items(data.Grpid) >
<p>{{data.GroupName}}</p>
</div>
.ts code
items(Grpid){
}
Now my question is how can i get data/list of items when ever i click on the particular group suppose if i click on the DESKTOPS then all the items related to desktop has to be displayed
Trying the solution:
