mirror of
https://github.com/Foltik/Shimapan
synced 2024-11-30 22:41:47 -05:00
22 lines
553 B
JavaScript
22 lines
553 B
JavaScript
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);
|
|
});
|
|
};
|
|
}]); |