Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

we are currently developing a little AngularJS project and starting from the frontend, so pure HTML and JavaScript.

However, we need to make some API calls using ngResource. At the moment we are using canned to mock the json return value.

Say this returns a JSON:

GET http://ip-address/something/1.json

I want to be able to call this from ngResource:

app.controller('SomethingCtrl', function ($scope, $resource) {
  Something = $resource("/something/:id", {id: "@id"});
  $scope.something = Something.get({id:1});
});

For some reason this does not work, although the endpoint is working correctly. Angular just makes an option request to this URL.

Is this some kind of XSS protection magic and how do I solve it?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.