1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-15 09:08:06 -05:00
shimapan/app/public/services/StatSvc.js

24 lines
559 B
JavaScript
Raw Normal View History

2018-09-15 18:25:07 -04:00
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);
});
}]);