Vincent
Vincent

Reputation: 6188

Last element of ng-repeat

<span ng-repeat="sla in terminals">
    {{sla}},
</span>

Is there a way to not generate the komma on the last element of the repeat?

Upvotes: 3

Views: 157

Answers (2)

Ilan Frumer
Ilan Frumer

Reputation: 32397

You can do it without ng-repeat:

{{ terminals.join(',') }}

Upvotes: 1

michael
michael

Reputation: 16361

yes it is:

 {{sla}}{{ ($last ) ? '' : ','}}

Upvotes: 9

Related Questions