JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.min.js"></script>
<script>
var myApp = angular.module('myApp', []);
myApp.filter('csv', function() {
return function(values, property_name) {
var result = '';
for (var i = 0; i < values.length; i++) {
var value = values[i];
if (property_name) {
value = value[property_name];
}
result += value;
if (i + 1 != values.length) {
result += ',';
}
}
return result;
};
});
myApp.controller('FriendsCtrl', function($scope) {
$scope.friends = [{
email: ['abc', 'def'],
name: "i'm noob"
}, {
email: ['ghi', 'jkl'],
name: "me 2"
}, {
email: ['ghi', 'jkl'],
name: "and me!"
}];
});
</script>
<div ng-app="myApp" ng-controller="FriendsCtrl">
<div>{{friends | csv:'name'}}</div>
</div>