Skip to content

Instantly share code, notes, and snippets.

@FMastro
Created March 28, 2014 02:16
Show Gist options
  • Save FMastro/9823755 to your computer and use it in GitHub Desktop.
Save FMastro/9823755 to your computer and use it in GitHub Desktop.
eventsApp.factory('MovieService', function($resource) {
return {
getMovie: function() {
return $resource('http://api.rottentomatoes.com/api/public/v1.0/movies/770672122.json?apikey=6zrhq6qq2sjgh8c7qsfgddg5').get();
}
};
});
eventsApp.controller('MovieController',
function MovieController($scope, MovieService) {
$scope.pageTitle = "Movie Details";
$scope.movie = MovieService.getMovie();
});
@FMastro
Copy link
Author

FMastro commented Mar 28, 2014

then I tried
return $resource('http://api.rottentomatoes.com/api/public/v1.0/movies/770672122.json?apikey=6zrhq6qq2sjgh8c7qsfgddg5', {}, { jsonpquery: { method: 'JSONP' } }).get();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment