Skip to content

Instantly share code, notes, and snippets.

@yannbertrand
Last active June 13, 2018 17:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yannbertrand/0bd1f994dee64f73f45b to your computer and use it in GitHub Desktop.
Save yannbertrand/0bd1f994dee64f73f45b to your computer and use it in GitHub Desktop.
Bullshit code from Angular
$resource(a, b, {
getSomething: {
method: 'GET',
url: baseUrl + ':id' // work if you pass the `id` param in the parameters object
},
postSomething: {
method: 'POST',
url: baseUrl + ':id', // you need to add the next line to make it work for post requests (didn't try with other verbs)
params: { id: '@id' }
}
});
// #Consistency
user.id as user.name for user in users | orderBy: 'name' track by user.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment