如何在 Angular 中将数据发送到 ng-click 函数?
How to send data- to ng-click function in Angular?
<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) 函数中?
您可以直接在 ng-click
中传递该变量
ng-click='editResponsible(newResponsible, ticket._id)'
<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) 函数中?
您可以直接在 ng-click
ng-click='editResponsible(newResponsible, ticket._id)'