Skip to content

Instantly share code, notes, and snippets.

@fedorovsky
Created January 11, 2017 16:47
Show Gist options
  • Save fedorovsky/74ade61f8f9f403761094b5f593e50c2 to your computer and use it in GitHub Desktop.
Save fedorovsky/74ade61f8f9f403761094b5f593e50c2 to your computer and use it in GitHub Desktop.
angular.module('myModule')
.service('UserService', ['$rootScope', '$http', '$log', '$localStorage', 'API_URL', function($rootScope, $http, $log, $localStorage, API_URL) {
/**
* GET USERS
*/
this.getUsers = () => {
let URL = API_URL.GET_USERS;
let _data = {
api_token: $localStorage.apiToken,
lang: $rootScope.lang,
web: true,
};
return $http.post(URL, _data).then((response) => {
return response.data.data.users;
});
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment