I have a array of objects with property 'name'.
<script>
function FriendsCtrl($scope) {
$scope.friends = [{
email: ['abc', 'def'],
name: "i'm noob"
}, {
email: ['ghi', 'jkl'],
name: "me 2"
},
{
email: ['ghi', 'jkl'],
name: "and me!"
}];
}
</script>
I want to list as string all names inside a div, separated with ',' I managed to do it this way, using underscore:
<span ng-repeat="email in friends">{{email.name}}{{$last ? '' : ', '}}</span>
Rez:
i'm noob, me 2, and me!
How to solve this problem using angular way?
Thanks!
Fiddle: http://jsfiddle.net/UJEnt/