如何在Angular中发送数据到ng-click功能?

时间:2015-08-25 18:01:19

标签: javascript angularjs data-binding angularjs-ng-click

<td>
  <select ng-options="user.username as user.username for user in dptUsers" 
    ng-model="newResponsible" data-ticketID='{{ticket._id}}' 
    ng-click='editResponsible(newResponsible, <<<<>>>>)'>
                                 {{user.username}}
  </select> 
</td>

如何将我的data-ticketID传递到editResponsible(a,b)函数?

1 个答案:

答案 0 :(得分:1)

您可以直接在ng-click

中传递该变量
ng-click='editResponsible(newResponsible, ticket._id)'