istic-openstack/client/js/controllers/image/image.js

27 lines
479 B
JavaScript
Raw Normal View History

2016-03-06 14:51:50 +01:00
/**
* The image controller
*
* @param {$scope} $scope The $scope service from angular
*/
2016-03-20 11:23:06 +01:00
mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity', function ($scope, Image, Loading, Identity)
2016-03-06 14:51:50 +01:00
{
2016-03-20 11:23:06 +01:00
2016-03-06 15:04:47 +01:00
var callbackTest=function(){
$scope.images=Image.getData().images;
2016-03-20 11:23:06 +01:00
Loading.stop();
2016-03-06 15:04:47 +01:00
};
2016-03-06 15:10:34 +01:00
2016-03-20 11:23:06 +01:00
if(Identity.isAlreadyLogin()){
if(Image.getData().images==null){
Loading.start();
Image.getImages(callbackTest);
}
else{
callbackTest();
}
}
2016-03-06 15:04:47 +01:00
}]);