Skip to content

Instantly share code, notes, and snippets.

@chazcheadle
Created November 21, 2014 15:36
Show Gist options
  • Select an option

  • Save chazcheadle/9a065374f6cd884c18fa to your computer and use it in GitHub Desktop.

Select an option

Save chazcheadle/9a065374f6cd884c18fa to your computer and use it in GitHub Desktop.
Angular - $resource factory
.factory('myFactory', ['$resource', function ($resource) {
return $resource('FEED_URL', {
callback: 'JSON_CALLBACK',
// URL parameter
form: 'json'
}, {
get: {
// Used to get resources from other domains and namespace multiple calls
method: 'JSONP',
// These are the ?<PARAM=VALUE>&... queries
params: {
},
cache: false
}
}
);
}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment