diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-20 11:23:06 +0100 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-20 11:23:06 +0100 |
| commit | 57006dba22e26273b6bcb75fff73522fb5f216f8 (patch) | |
| tree | 382bc2675ab08519a405e285f8fa0e334fe497f4 /client/js/controllers/image | |
| parent | 0ce2b2fa301dde1c5b9c50c826d3ed44b00a5c44 (diff) | |
Add login check
Diffstat (limited to 'client/js/controllers/image')
| -rw-r--r-- | client/js/controllers/image/image.js | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/client/js/controllers/image/image.js b/client/js/controllers/image/image.js index d499acb..b0b162b 100644 --- a/client/js/controllers/image/image.js +++ b/client/js/controllers/image/image.js @@ -3,23 +3,27 @@ * * @param {$scope} $scope The $scope service from angular */ -mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading',function ($scope, Image, Loading) +mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity', function ($scope, Image, Loading, Identity) { + var callbackTest=function(){ $scope.images=Image.getData().images; - Loading.stop(); + Loading.stop(); }; - if(Image.getData().images==null){ - Loading.start(); - Image.getImages(callbackTest); - } - else{ - callbackTest(); - } - $scope.doUpload = function () { Image.uploadImage($scope.myFile,function(){}); }; + if(Identity.isAlreadyLogin()){ + + if(Image.getData().images==null){ + Loading.start(); + Image.getImages(callbackTest); + } + else{ + callbackTest(); + } + + } }]); |
