javascript - Angular can not call google API service -


i trying use google place service

$http({     method : 'get',     url : 'https://maps.googleapis.com/maps/api/place/textsearch/json?query=hotels in us&key=xxxxxxxxx&callback=json_callback' }) .success(function(data) {     console.log('data' + data); }) .error(function(data) { }); 

api call ok 200. on console gives error xmlhttprequest cannot load https://maps.googleapis.com/maps/api/place/textsearch/json?query=hotels%20in%20us&key=xxxxu&callback=json_callback. no 'access-control-allow-origin' header present on requested resource. origin 'https://192.168.1.85:8443' therefore not allowed access.

i change method:jsonp returns data syntax error : required. server tomcat 7. using cors filtercom.thetransactioncompany.cors.corsfilter .

try changing $http() $http.jsonp(url).succes....


Comments

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -