JohnnyTrous JohnnyTrous - 2 years ago 145
AngularJS Question

AngularJS ng-repeat get data from JSON

I got a problem on getting data from


<tr ng-repeat="x in records">

is the
I want to get from the JSON.

Here is the JSON:

"title":"The Frozen North",
"title":"Midnight in Paris",

I can get the note, title and year correctly. But how can I get the id (such as
) from the JSON?

Answer Source

There is no notion in javascript (or angular) that tt0013158 in the sample above would be the object's id. It's just a key in a map.

I believe this should do the trick:

<tr ng-repeat="(key, x) in records.result">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download