This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |