angularjs - ODataAngularResources not parse OData 4 response -
i try call odata v4 service odataangularresources typescript.
for test purpose use northwind products odata service
here code wich call service:
var results = this.$odataresource("http://services.odata.org/v4/northwind/northwind.svc/products") .odata() .filter("unitprice", ">", 10) .filter("discontinued", true) .take(2) .query();
request url :http://services.odata.org/v4/northwind/northwind.svc/products?$filter=(unitprice%20gt%2010)%20and%20(discontinued%20eq%20true)&$top=2
response :
{ "@odata.context":"http://services.odata.org/v4/northwind/northwind.svc/$metadata#products", "value":[ { "productid":5, "productname":"chef anton's gumbo mix", "supplierid":2, "categoryid":2, "quantityperunit":"36 boxes", "unitprice":21.3500, "unitsinstock":0, "unitsonorder":0, "reorderlevel":0, "discontinued":true }, { "productid":9, "productname":"mishi kobe niku", "supplierid":4, "categoryid":6, "quantityperunit":"18 - 500 g pkgs.", "unitprice":97.0000, "unitsinstock":29, "unitsonorder":0, "reorderlevel":0, "discontinued":true } ] }
deserialized response:
[$promise: promise, $resolved: false] 0: resource 1: resource $promise: promise $resolved: true @odata.context: "http://services.odata.org/v4/northwind/northwind.svc/$metadata#products" length: 2 __proto__: array[0]
i have deserialized response array of product object.
i dont’t know can problem.
in app use odataresources ngresource.
Comments
Post a Comment