Skip to content

Instantly share code, notes, and snippets.

View RickEyre's full-sized avatar
💭
👑 the crown is in the code base

Rick Eyre RickEyre

💭
👑 the crown is in the code base
View GitHub Profile
function UserFactory($http) {
var factory = {};
var users = {};
factory.load = function load() {
// Return promise returned by $http.get
return $http.get('http://localhost:3000/users')
.success(function(data) {
angular.forEach(data, function(item, index) {
users[data.id] = data;