(function () { 'use strict'; angular .module('app') .factory('UserService', UserService); UserService.$inject = ['$http']; function UserService($http) { var service = {}; service.GetAll = GetAll; return service; function GetAll(page) { return $http.get('https://api.github.com/users').then(handleSuccess, handleError('Error getting all users')); } // private functions function handleSuccess(res) { return res.data; } function handleError(error) { return function () { return { success: false, message: error }; }; } }})();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)