Reputation: 6108
I have a list of elements (tags) that I want to show comma separated but last one. But it´s not working. Commas are not displayed.
<span ng-repeat="tag in post.tags"><a href="">{{tag.name | translate}}</a><span ng-show="{{!$last}}">, </span></span>
Upvotes: 1
Views: 997
Reputation: 828
I tried to do the similar example and looks like the problem is with a filter 'translate'
{{tag.name | translate}}
http://jsfiddle.net/kikill/re4x99ra/
Upvotes: 1
Reputation: 6982
Try ng-hide="$last"
instead. You don't need {{
and }}
in this context.
Upvotes: 1
Reputation: 6108
All right,
I finally solved it with: {{{true: '', false: ', '}[$last]}}
Upvotes: 0