Add login check
This commit is contained in:
parent
0ce2b2fa30
commit
57006dba22
5 changed files with 44 additions and 33 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
}]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue