Yesterday I had an issue using AngularJS’s $http.jsonp method to fetch data from a separate API service which I built.

It turns out that the issue was with my API and not the client.

I had to add cross-domain JSONP support.

api_controller.rb
1
2
3
...
render :json => @items.to_json, :callback => params[:callback]
...

Source: JSONP in Rails

Comments