javascript - ng-repeat don't show last piece of text -


i have list of answers separate comma, not want last comma show - how can using ng-repeat , !$last? html have far (which not showing entire last answer):

<h3 ng-repeat="answer in correctanswers" ng-show="!$last">     {{answer + "," + " " }} </h3> 

i recommend not using separate span , toggling visibility, use closer have attempted:

 <h3 ng-repeat="answer in correctanswers">     {{answer + ($last ? '' : ',')}} </h3> 

no directives processed, simple boolean logic w/ concatenation of string


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -