使用Web API的ngresource自定义方法

时间:2015-04-27 01:46:21

标签: angularjs asp.net-web-api ngresource

无法使用web api中的ngresource.getting null值传递自定义对象。

 app.factory("Entry", function ($resource) {
                return $resource("/api/Emp/",
                    { },
                    {

                        "putmethod1": { 'url': '/TestEmployee', 'method': 'GET', 'params': { employee: '@employee' } }

                    }
                );
            });




postData = {
                    "id": 1,
                    "Empname": "The Hitchhiker's Guide to the Galaxy",
                    "Address": "Douglas Adams"
                };

     var ent = Entry.putmethod1({ employee: postData });

Web api

    [Route("TestEmployee")]
    public IHttpActionResult GETEmployee1(Employee employee)
    {
    }  

Employee对象为null。请告诉我哪里出错了?

0 个答案:

没有答案