If I have the following factories:
.factory('User', function($resource) {
return $resource('/users/:id', {id: "@id"}, {
query: {method: 'GET', params: {}, isArray: false}
});
})
.factory('UserList', function(User, $q) {
var deferred = $q.defer();
User.query({}, function(response) {
deferred.resolve(response.data);
});
return deferred.promise;
})
I know have a UserList that I can inject into all my controllers that need it. But, if I later in my application create a new user, how can I make the 'UserList'-factory "refresh"? Is there another approach that is (even) more "The Angular Way"?