Uncaught SyntaxError: Unexpected token : in AngularJS-Collection of common programming errors
I’ve been working on this for a few hours and can’t seem to get anywhere. I hope this is the right place to post this. I’m new to StackOverflow so please guide me to the right place if this isn’t correct.
I have the following html file:
{{restaurant.name}} |
And the following in my dishclips.js:
angular.module('DishClips', ['ngResource']);
function DishClipsCtrl($scope, $resource) {
$scope.dishclips = $resource('http://apiv2.dishclips.com/dishclips/api/:action',
{action:'searchRestaurants',address:'irvine',callback:'JSON_CALLBACK' },
{get:{method:'JSONP'}});
$scope.dishclipsResult = $scope.dishclips.get();
}
When I run this (in chrome) I get:
Uncaught SyntaxError: Unexpected token :
The json return looks great so I don’t understand why this is an issue.
Thanks