search

Home  >  Q&A  >  body text

angular.js - How to bind events to tags looped out by ng-repeat in Angular?

You need to use ng-repeat to loop out the data sent from the background, and also bind events to this tag to operate on this data. Is there a perfect solution?

阿神阿神2755 days ago724

reply all(1)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-06-05 11:12:09

    <li ng-repeat="a in datas" ng-click="event(a)">
    datas是数据集合,event是事件,a是集合的每一个元素

    reply
    0
  • Cancelreply