1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-12-11 22:12:18 -05:00
shimapan/app/public/services/UserSvc.js

22 lines
553 B
JavaScript
Raw Normal View History

2018-01-15 11:46:49 -05:00
var angular = require('angular');
angular.module('UserSvc', []).service('UserService', ['$http', function($http) {
this.getUser = function(username, cb) {
$http({
method: 'GET',
url: '/api/users/get',
params: {username: username}
}).then(function(res) {
cb(res.data);
});
};
this.getAllUsers = function(cb) {
$http({
method: 'GET',
url: '/api/users/get'
}).then(function(res) {
cb(res.data);
});
};
}]);