weightService.js 673 B

12345678910111213141516171819202122232425262728293031
  1. angular.module("robware").service('weightService', ["$http", function($http) {
  2. this.addWeight=function(weight, fat){
  3. return $http({
  4. method:'post',
  5. url:'/weight/add',
  6. data:{weight:weight, fat:fat},
  7. showSpinner:true
  8. }).then(function(response){
  9. return response.data;
  10. });
  11. };
  12. this.deleteWeight=function(id){
  13. return $http({
  14. method:'post',
  15. url:'/weight/delete',
  16. data:{id:id},
  17. showSpinner:true
  18. }).then(function(response){
  19. return response.data;
  20. });
  21. };
  22. this.getReadings=function(){
  23. return $http({
  24. method:'post',
  25. url:'/weight/getreadings',
  26. showSpinner:true
  27. }).then(function(response){
  28. return response.data;
  29. });
  30. };
  31. }]);