Skip to content

Instantly share code, notes, and snippets.

@samirbr
Last active August 29, 2015 14:24
Show Gist options
  • Save samirbr/a98ca62a2efca1fe97d5 to your computer and use it in GitHub Desktop.
Save samirbr/a98ca62a2efca1fe97d5 to your computer and use it in GitHub Desktop.
angular.module('myApp')
.factory('Harvest', [
'$resource',
function ($resource) {
return $resource('/viewver/api/harvest_viewver/?id', {'id': '@id'}, {
create: { method: 'POST' }
update: { method: 'PUT' }
});
}
]);
harvests = {{ harvest_json|safe }}.map(function (harvest) {
var h new Harvest(harvest);
h.value = new Value(h.value);
return h;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment