WebAPI returns json or xml in accordance with the request. Make sure you're requesting application/json in accept header (view in fiddle, or chrome inspect, or firebug, etc).
An alternative is set WebAPI to return always as json, removing xml formater, or changing the content negotiator: http://stackoverflow.com/questions/12629144/how-to-force-asp-net-web-api-to-always-return-json []s William Thiago On Monday, October 20, 2014 10:48:10 AM UTC-2, Mauro Servienti wrote: > > It was on a Mvc controller, but now is an Api Controller . And I have > the same problem. > > I want to use Web api. > > *[.m] in MVC that can’t work, full stop, you need to introduce some sort > of a “JsonResult” on the server, in WebAPI it works out-of-the-box, I do > that the entire day :-)* > > *You do not need the JSON.parse on the angular side, what you get back is > already a valid json response, take a look with the browser tools :-)* > > > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
