Click here to Skip to main content
15,890,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My Angular code goes below
PHP
var data=['asdfgh','fghjkl','qwerty'];
return $http.post(url, JSON.stringify(data)).then(function (result) {
            return result.data;
        });

My web api controller is
SQL
public class V1MessageController : ODataController
{
[AuthorizeClaims(ClaimTypes.NameIdentifier
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance",           "CA1804:RemoveUnusedLocals", MessageId = "messageId", Justification = "Test"), HttpPost]
public IHttpActionResult MarkAsReadMessages(ODataActionParameters odataParameters)
  {
     //Code for implementation
  }
}

If i am passing a simple string,instead of a string of array to same controller method with different parameter it is working fine.
SQL
public IHttpActionResult MarkAsReadMessages(Guid key)
  {
     //Code for implementation
  }

Only problem is with string of array.I am unable to pass a string of array to that particular action method.I think this is a compatibility issue of angular with that of ODataController type class member.Please anybody help me out.I am struck with this problem,not able to figure out what to do next.Thanx in advance,
Posted
Comments
karthik Udhayakumar 22-May-14 12:26pm    
Jitendra,
Did you check in the angular.js community for similar post?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900