I've been working on this for awhile now and I'm quite frustrated. I just need to grab simple data about about a specific location.
Here is the code I'm using in Angular:
function getGoogle($http, $sce) {
var url = $sce.trustAsResourceUrl('https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=mykey');
var result = $http.jsonp(url, {jsonpCallbackParam: 'angular.callbacks._0'}).then(function(data){
console.log(data);
});
}
function config($stateProvider, $locationProvider){
$stateProvider
.state('sbucks', {
url: '/',
templateUrl: 'app/app.html',
controller: 'AppCtrl as app',
resolve: {
cool: getGoogle
}
});
$locationProvider.html5Mode(true);
}
function AppCtrl(cool){
var vm = this;
//console.log(cool);
}
angular.module('sbucks', [
'ui.router',
'sbucks.santamonica',
'sbucks.newyork',
'sbucks.london'
])
.config(config)
.controller('AppCtrl', AppCtrl)
;
These are the errors I keep getting:
Error 1: "Uncaught SyntaxError: Unexpected token : angular.js:14516"
Error 2: Possibly unhandled rejection: {"data":false,"status":404,"config":{"method":"JSONP","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"angular.callbacks._0","url":{},"headers":{"Accept":"application/json, text/plain, /"}},"statusText":"error"}
I know I'm doing something dumb, just totally stuck and frustrated.

.thencallback. In this instance you got a 404 so either there is no API method associated with the URL path of the request, or the request refers to one or more resources that were not found. - cnorthfield$http.get, not$http.jsonp. - georgeawgjsonpCallbackParam: 'angular.callbacks._0'? Don't copy random code from StackOverflow. Never use code you don't understand. It definitely won't help you later and it could be, at best, very embarrassing if you are asked to explain code. - georgeawg