Add login check

This commit is contained in:
manzerbredes 2016-03-20 11:23:06 +01:00
parent 0ce2b2fa30
commit 57006dba22
5 changed files with 44 additions and 33 deletions

View file

@ -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();
}
}
}]);