Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. packlightApp.factory('Hike', ['$resource',
  2. function ($resource) {
  3. return $resource('app/rest/hikes/:id', {}, {
  4. 'query': { method: 'GET', isArray: true},
  5. 'get': { method: 'GET'},
  6.  
  7. });
  8. }]);
  9.  
  10. @RequestMapping(value = "/rest/hikes",
  11. method = RequestMethod.POST,
  12. produces = "application/json")
  13. public void create(@RequestBody HikeDto hikedto) {...}
  14.  
  15. app.controller('postCtrl', function($scope, Hike) {
  16. var objectArray = [{data: 1}, {data: 2}];
  17. Hike.save({id: 'yourId'}, objectArray, function(response) {
  18. console.log(response);
  19. // Do things on success.
  20. });
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement