istic-openstack/client/js/controllers/image/image.js
2016-03-21 06:47:01 +01:00

26 lines
479 B
JavaScript

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