atulquest93 atulquest93 - 6 months ago 64
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.


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

<span ng-repeat="tag in tags">
   {{tag + ($last ? "" : ",")}}