I have data like this:
var user = {
name: 'John Doe',
property: 'value',
ranks: [
{name: 'One', property: 'value'},
{name: 'Two', property: 'value'}
]
}
I want to output somewhere in the page all user's rank names divided by commas, like this:
<td>John Doe</td>
<td>One, Two</td>
How to do this?
Pure javascript isn't working:
<td>{{user.name}}</td>
<td>{{user.ranks.map(function(r) { return r.name }).join(', ')}}</td>
I think here should be an Angular filter or something, but can't find anything.