1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-12-04 19:32:20 -05:00
shimapan/app/public/services/StatSvc.js
2018-09-15 18:25:07 -04:00

24 lines
559 B
JavaScript

var angular = require('angular');
angular.module('StatSvc', []).service('StatService', ['$http', function($http) {
this.getWeek = cb =>
$http({
method: 'GET',
url: '/api/stats/week'
}).then(res => {
cb(null, res.data)
}).catch(err => {
cb(err);
});
this.getAll = cb =>
$http({
method: 'GET',
url: '/api/stats/all'
}).then(res => {
cb(null, res.data[0])
}).catch(err => {
cb(err);
});
}]);