Challenge repeating tr with ng-repeat

前端 未结 3 1097
执念已碎
执念已碎 2020-12-30 04:56

I\'m struggling with a special use case. I provide you with a jsfiddle snippet at the bottom.

1. The HTML table

My HTML is a table. ng

3条回答
  •  渐次进展
    2020-12-30 05:10

    You can use tbody tag for groupping multiple tr together and use ngRepeat to loop over it.

    http://jsfiddle.net/RkCMr/4/

    how can I refactor it out using ng-repeat?

    click {{item}}
    --> comment {{item}}

    By the way, it looks like your code is still in Jquery way of doing things. Even you've put them in a directive. As shown in the example above, a directive is not necessary at all and JQuery is not used.

提交回复
热议问题