Here is my sample json , i am getting my json obj from firebase i have to convert the list in to array to bind in html trough ng-repeat.
my Json object is
{
"cats1": {
"Name": "cricket",
"imgUrl": "some url",
"list1": {
"bat": {
"Name": "bat",
"imgUrl": "some url",
"price": "$100"
},
"pads": {
"displayName": "pads",
"imgUrl": "some url",
"price": "$50"
}
}
},
"cats2": {
"Name": "football",
"imgUrl": "some url"
}
}
this is how i required
this is the array structure i required , when i add the new list it must store uniquely in cricket category.
[
{
"Name": "cricket",
"imgUrl": "some url",
"list1": [
{
"Name": "bat",
"imgUrl": "some url",
"price": "$100"
},
{
"displayName": "pads",
"imgUrl": "some url",
"price": "$50"
}
]
},
{
"Name": "football",
"imgUrl": "some url"
}
]
i am new to angular any one please help me to figure out this problem
Object.keys(data).map(x=>data[x])