summaryrefslogtreecommitdiff
path: root/client/js/controllers/image/image.js
diff options
context:
space:
mode:
authorroot <root@kabir-PC>2016-03-23 11:31:51 +0100
committerroot <root@kabir-PC>2016-03-23 11:31:51 +0100
commita26989103d70fb0dd3ff6834de107cae246778c3 (patch)
tree0f243c83b790ffb57f19261fc2a509131f6776ce /client/js/controllers/image/image.js
parent1342db60283cb61a1c3810993575d35b9fb33ac0 (diff)
parent6e78d76f887d1149ea85bfb06db7ee7ad7435f5a (diff)
Merge branch 'develop' of https://github.com/manzerbredes/istic-openstack into develop
Diffstat (limited to 'client/js/controllers/image/image.js')
-rw-r--r--client/js/controllers/image/image.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/client/js/controllers/image/image.js b/client/js/controllers/image/image.js
new file mode 100644
index 0000000..b0b162b
--- /dev/null
+++ b/client/js/controllers/image/image.js
@@ -0,0 +1,29 @@
+/**
+ * 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();
+ };
+
+ $scope.doUpload = function () {
+ Image.uploadImage($scope.myFile,function(){});
+ };
+
+ if(Identity.isAlreadyLogin()){
+
+ if(Image.getData().images==null){
+ Loading.start();
+ Image.getImages(callbackTest);
+ }
+ else{
+ callbackTest();
+ }
+
+ }
+}]);