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
Post a Comment