/**
 * The image controller
 * 
 * @param {$scope} $scope The $scope service from angular
 */
mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading',function ($scope, Image, Loading)
{
	var callbackTest=function(){
		$scope.images=Image.getData().images;
				Loading.stop();
	};

	if(Image.getData().images==null){
		Loading.start();
		Image.getImages(callbackTest);
	}
	else{
		callbackTest();
	}

	$scope.doUpload = function () {
		Image.uploadImage($scope.myFile,function(){});
	};
	
}]);