Created
November 21, 2014 15:36
-
-
Save chazcheadle/9a065374f6cd884c18fa to your computer and use it in GitHub Desktop.
Angular - $resource factory
This file contains hidden or 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
| .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