ihr.factory('playerFactory', ['$q', '$http', 'config', function($q, $http, config) {
	return {
		url: config.apiServer+'/players',
		getPlayers: function(){
			var deferred = $q.defer();
				$http.get(this.url).then(function(response) {
				// Check data is not null
				if(!response.data) {
					deferred.reject('Bad object');
				} else {
					deferred.resolve(response.data);
				}
			}, function(error) {
				deferred.reject('Error in request: ' + error.statusText);
			});
			
			return deferred.promise;
		},
		
	};
}]);
@@ -510,16 +510,433 @@
 %0A%09%09%7D,%0A%09%09
+updatePlayer: function()%7B%0A%09%09%09var deferred = $q.defer();%0A%09%09%09%0A%09%09%09$http.post(this.url + '/' + player.id, player).then(function(responseData) %7B%0A%09%09%09%09if(responseData.data.success) %7B%0A%09%09%09%09%09deferred.resolve(responseData);%0A%09%09%09%09%7D else %7B%0A%09%09%09%09%09deferred.reject(responseData.data.error);%0A%09%09%09%09%7D%0A%09%09%09%7D, function (error) %7B%0A%09%09%09%09deferred.reject('Error in update: ' + error.responseData.statusText);%0A%09%09%09%7D);%0A%09%09%09return deferred.promise;%0A%09%09%7D,
 %0A%09%7D;%0A%7D%5D)

fix playerFactory