summaryrefslogtreecommitdiff
path: root/client/js/controllers/image/image.js
blob: b0b162b639080dfece772d590d115e354ec7bdda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * The image controller
 * 
 * @param {$scope} $scope The $scope service from angular
 */
mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity', function ($scope, Image, Loading, Identity)
{

	var callbackTest=function(){
		$scope.images=Image.getData().images;
		Loading.stop();
	};

	$scope.doUpload = function () {
		Image.uploadImage($scope.myFile,function(){});
	};
	
	if(Identity.isAlreadyLogin()){

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

	}	
}]);