dimanche 29 novembre 2015

AngularJS CheckItems selected Items to Delete as HTTP Request

I want to use a Button Click, so when this Button gets clicked

<button type="button" ng-click="delete()">Delete</button>

to use this function,

$scope.delete = function() {    


for( i=0; <each selected Item , i++) 

I dont know how to code this in Javascript, but lets say 10 Items are selected with the Checkbox and I want to make 10 Http Delete Requests the Parameter ID of the Selection needed as a Parameter for the Rest Service . Username and Password are saved somewhere else.

$http.get("https://localhost/delete?username=" + $scope.email1 + "&password=" + $scope.password1 +&scope.selectedItemID).success(function(response)
}
    })  

This is the Html File:

<tr ng-repeat="Object in ObjectList track by $index">
        <td>
            <input type="checkbox" ng-model="Object.isCheck" ng-change="checkChange(Object)"/>
        </td>   
                            <td>{{ Object.idObject}}</td>
                            <td>{{ Object.messageObject }}</td>         
                        </tr>
                    </tbody>
                </table>            
</div>




Aucun commentaire:

Enregistrer un commentaire