Comma Separated

angular

前端 未结 7 1059
清歌不尽
清歌不尽 2020-12-31 17:25

I have a pretty basic scenario (somewhat new to angular). I am trying to convert JSON:

[
    {\'name\': \'Nick\'},
    {\'name\': \'David\'},
    {\'name\':         


        
相关标签:
7条回答
  • 2020-12-31 18:08

    You could also accomplish that like this:

    <p>    
       <span ng-repeat="(item,name) in menuItems">{{name}}{{$last ? '' : ', '}} </span>
    </p>
    

    I used this approach on a similar issue I had, I try to never mix javascript/jquery and angular. Got the solution from here: Using comma as list separator with AngularJS

    0 讨论(0)
提交回复
热议问题