Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // define productsData
- var productsData;
- function getProductsData() {
- client.invokeApi("category", {
- method: "post",
- body: {
- "latitude": "48.8135560",
- "longitude": "2.3928829"
- }
- }).done(function (results) {
- var response = JSON.parse(results.response);
- // get informations from the API "category"
- var productsArray = new Array();
- response.forEach(function (i) {
- productsArray.push({
- Id : i.Id,
- restaurant_Id : i.restaurant_Id,
- category_Id : i.category_Id,
- name : i.name,
- image : i.image,
- distance : i.distance
- });
- });
- // create productsData binding
- productsData = new WinJS.Binding.List(productsArray);
- WinJS.UI.processAll();
- });
- }
- getProductsData();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement