angularjs - How to pass a array into webapi function? -


i want pass array webapi.

here function getting checkbox selected items in albumnamearray.

$scope.delete = function () {         debugger         $scope.albumnamearray = [];         angular.foreach($scope.inboxlist, function (cu) {             if (cu.selected) $scope.albumnamearray.push(cu.inboxmailid);         })     } 

now want send albumnamearray webapi function. have modified delete function not working, wrong in code?

$scope.delete = function () {         debugger         $scope.albumnamearray = [];         angular.foreach($scope.inboxlist, function (cu) {             if (cu.selected) $scope.albumnamearray.push(cu.inboxmailid);         }).$http({         url: "mailroute/deleteselecetedemail",         datatype: 'json',         method: 'post',         data: albumnamearray,         headers: {             "content-type": "application/json"         }      }).success(function (response) {         debugger         if (response != null) {          }      })       .error(function (error) {           alert(error);       }); } 

try this:

public httpresponsemessage delete(string data) {     if (something!= 0)     {      }     else     {      }     return response; } 

if not working try list


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -