atulquest93 atulquest93 - 1 year ago 123
AngularJS Question

Using ng-if inside ng-bind Angular Js

<span ng-repeat="tag in tags">
{{tag + "," }}

I need to remove
after the last element. I know
can solve the problem. But, as I don't have any parent element for
I can't use
so, just need some work around.

Answer Source

You should use a ternary together with () in order to prevent weird outcome:

<span ng-repeat="tag in tags">
   {{tag + ($last ? "" : ",")}}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download