angular
I have a pretty basic scenario (somewhat new to angular). I am trying to convert JSON:
[
{\'name\': \'Nick\'},
{\'name\': \'David\'},
{\'name\':
If you are open to use instead of, then following array of objects,
[
{ "name": "John" },
{ "name": "David" },
{ "name": "Gopal" },
{ "name": "Anil" },
{ "name": "Gurjeet" }
]
can be displayed as: John, David, Gopal, Anil and Gurjeet
with this code snippet:
{{$first ? '' : $last ? ' and ' : ', '}}{{admin.name}}
Got this solution from: AngularJS ng-repeat, comma separated with 'and' before the last item
Thanks!