New to angularjs and trying to figure out how to print using ng-repeat.
My JSON feed looks like this:
[
{
"metric": [
{
"event": [
{
"id": 1,
"name": "Wedding",
"date": "2013-12-17",
"time": "2000-01-01T20:47:46Z",
"description": "Wedding Desc",
"address": "Wedding Address",
}
]
},
{
"meal": [
{
"id": 1,
"name": "Chicken",
"description": "Chicken Yum!",
}
]
}
]
},
{
"metric": [
{
"event": [
{
"id": 2,
"name": "Rehersal",
"date": "2013-12-17",
"time": "2000-01-01T20:47:46Z",
"description": "Rehersal Desc",
"address": "Rehersal Address"
}
]
},
{
"meal": [
{
"id": 2,
"name": "Steak",
"description": "9oz"
}
]
}
]
}
]
And for each "metric" I would like to print it out like this
Event Name:
Date:
Time:
Address:
Event Description:
Meal Name:
Meal Description:
On my template I have:
<div ng-repeat="metric in eventmetrics">
{{ metric }}
</div>
This prints:
{"metric":[{"event":[{"id":1,"name":"Wedding","date":"2013-12-17","time":"2000-01-01T20:47:46Z","description":"Wedding Desc","address":"Wedding Address"}]},{"meal":[{"id":1,"name":"Chicken","description":"Chicken Yum!"}]}]}
{"metric":[{"event":[{"id":2,"name":"Rehersal","date":"2013-12-17","time":"2000-01-01T20:47:46Z","description":"Rehersal Desc","address":"Rehersal Address"}]},{"meal":[{"id":2,"name":"Steak","description":"9oz"}]}]}
Which shows the right info - however I can't go metric.event.name or metric.meal.name and I get nothing printed.
I checked out my JSON with JSONLint and it seems to validate.
Any help is much appreciated.