@deveps wrote:
I am trying to call specific JSON data from localy. Basically, I want a user to click on one of the category and get related menuItem to be displayed. I am able to get the category but I can’t get the meniItem to show.in Category and menuItem I have same field called ‘category’ amd it should match
Here’s my code: in home.html i have this
<ion-item text-wrap *ngFor=“let item of newsData” (click)=“open(menuItem, item)”>
{{item.title}}
{{item.desc}}
my data.json
{
“categories” : [
{
“category” :“101flashlight”,
“desc” : “Crackers with multiple sounds”,
“thumb” : “infw/thumb/flash.svg”,
“title” : “Flash Light Crackers”
},
{
“category”:“102zamin”,
“desc” : “Crackers with sparks”,
“thumb” : “infw/thumb/zamin.svg”,
“title” : “Zamin Chakkars”
}
],
“menuItems” : [
{
“name” : “1001party”,
“body” : “infw/detail/confetti/party”,
“category” : “102zamin”,
“code” : “”,
“content” : “2 Pieces per box”,
“desc” : “Crackers with multiple sounds”,
“packing” : “30 Boxes per case”,
“size” : “16x22x8cm”,
“tags” : “Confetti”,
“thumb” : “infw/thumb/partycannon.png”,
“title” : “Party Cannon”,
“video” :“infw/videos/coming_soon.webm”
},
{
“name” :“1002dollar”,
“body” : “infw/detail/confetti/dollar”,
“category” : “102zamin”,
“code” : “”,
“content” : “2 Pieces per box”,
“desc” : “Crackers with multiple sounds”,
“packing” : “30 Boxes per case”,
“size” : “52x12x5cm”,
“tags” : “Confetti”,
“thumb” : “infw/thumb/dollar.png”,
“title” : “Dollar”,
“video” : “infw/videos/coming_soon.webm”
},
{
“name” :“1014elephantspl”,
“body” : “infw/detail/flash/4splelephant”,
“category” : “101flashlight”,
“code” : “”,
“content” : “5 Pieces per packet”,
“desc” : “Crackers with multiple sounds”,
“packing” : “500 Packets per case”,
“size” : “16x22x8cm”,
“tags” : “Flash Light Crackers”,
“thumb” : “infw/thumb/4splelephant.png”,
“title” : “4’ Elephant Special Crackers”,
“video” : “infw/videos/coming_soon.webm”
},
{
“name” :“1024deluxelak”,
“body” : “infw/detail/flash/4deluxelak”,
“category” : “101flashlight”,
“code” : “”,
“content” : “5 Pieces per packet”,
“desc” : “Crackers with multiple sounds”,
“packing” : “300 Packets per case”,
“size” : “16x22x8cm”,
“tags” : “Flash Light Crackers”,
“thumb” : “infw/thumb/4deluxelak.png”,
“title” : “4’ Deluxe Lakshmi Crackers”,
“video” : “infw/videos/coming_soon.webm”
},
{
“name” :“1034deluxeele”,
“body” : “infw/detail/flash/4deluxeele”,
“category” : “101flashlight”,
“code” : “”,
“content” : “5 Pieces per packet”,
“desc” : “Crackers with multiple sounds”,
“packing” : “300 Packets per case”,
“size” : “16x22x8cm”,
“tags” : “Flash Light Crackers”,
“thumb” : “infw/thumb/4deluxeele.png”,
“title” : “4’ Deluxe Elephant Crackers”,
“video” : “videos/coming_soon.webm”
}
]output image
All i want is to show two categories,whenever i click one of them it should show the menuitems by matching the category column in both category and menuItem.
Posts: 1
Participants: 1