1

I want to create a service to connect to the prestashop API and use it. The prestashop API is like this:

http://APIKEY@domain/api/module

How can I use ngResource to support APIKEY params in the path and also allow cross-origins to connect another domain?

My sample code that doesn't work is:

    .factory('Presta_Products', function ($resource) {
  var data = $resource('http://1111111111111111111@localhost/shinatech/OnlineStore/prestashop/api/products/:id', {id: '@id'}, {
    update:{
      method:'PUT'
    }
  });
  return data;
})

It gives the error:

enter image description here

4

0 に答える 0