How to access the RESTful services from external server in my server in angularjs
问题 I am running on domain server1. I have my RESTful services on server2. I want to access this RESTful service on my webpage using angularjs. I tried this way. But it's returning an empty array. No data was bind. Why? any suggestions. Here is my sample code. 回答1: In your sample code, your resource definition looks like this: var UtilService = $resource('server2/users/:userId', { }, { 'get' : { method: 'GET',headers: {'Content-Type':'application/json'}, params: { userId:'anil' } , isArray : true