Reputation: 3
When i use the ng-click inside ng-repeat ,the function param is not work when i click the button.but in the dom is works .
$scope.Modify=function(a){
console.log("Edit"+a);
}
$scope.Del=function(a,b){
console.log("DEL:"+a);
Metronic.ajax("delete","vt/"+a,{},true,Metronic.handleResponse,delValue,b);
}
<tr ng-repeat="vr in data">
<td>{{$index}}</td>
<td>{{vr.type_name}}</td>
<td>{{vr.sort}}</td>
<td>
<a href="javascript:;" class="btn btn-xs btn-success" ng-click="Modify('{{vr.vt_id}}')">Edit</a>
<a href="javascript:;" class="btn btn-xs btn-danger" ng-click="Del($index)">Del</a>
</td>
</tr>
Upvotes: 0
Views: 37
Reputation: 2176
You don't need the curly braces when you are passing a variable into a function. Change ng-click="Modify('{{vr.vt_id}}')">
to ng-click="Modify(vr.vt_id)">
Upvotes: 1