Print values from JSON in a table.

18 views
Skip to first unread message

Alejo Ribes

unread,
Aug 23, 2016, 6:51:15 AM8/23/16
to AngularJS
Hi, i found this problem:
I get data for print from a json.
Print in a table:
Example:

<tbody ng:repeat= "i in vm.dataResponse">
<tr><td>{{i.date | date: fullDate }}</td><td>{{i.user.user-name}}</td><td>{{i.user.description}}</td><td>{{i.user.location}}</td><td>{{i.user.lang}}</td></tr>
</tbody>

Works correctly except {{i.user.user-name}}, i test with other property with '-' in key value and i found the same problem, in the view, prints 0.


Thanks


Alejo Ribes

unread,
Aug 23, 2016, 7:02:02 AM8/23/16
to AngularJS
I found the error, using:

{{i.user['user-name']}} 
Reply all
Reply to author
Forward
0 new messages