Using comma as list separator with AngularJS
You could do it this way:
<b ng-repeat="email in friend.email">{{email}}{{$last ? '' : ', '}}</b>
..But I like Philipp's answer :-)
Also:
angular.module('App.filters', [])
.filter('joinBy', function () {
return function (input,delimiter) {
return (input || []).join(delimiter || ',');
};
});
And in template:
{{ itemsArray | joinBy:',' }}
Just use Javascript's built-in join(separator)
function for arrays:
<li ng-repeat="friend in friends">
<b>{{friend.email.join(', ')}}</b>...
</li>