Created
March 28, 2014 02:16
-
-
Save FMastro/9823755 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
then I tried
return $resource('http://api.rottentomatoes.com/api/public/v1.0/movies/770672122.json?apikey=6zrhq6qq2sjgh8c7qsfgddg5', {}, { jsonpquery: { method: 'JSONP' } }).get();