summaryrefslogtreecommitdiff
path: root/client/js/controllers/image/image.js
blob: d9a9c065184755355bdebefb127fc6a000bb809f (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
/**
 * 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();
	};

	
	if(Identity.isAlreadyLogin()){

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

	}	
}]);