summaryrefslogtreecommitdiff
path: root/client/js/controllers/home/home.js
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2016-03-02 21:03:25 +0100
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2016-03-02 21:03:25 +0100
commitdde482df6492e874ffb30c3c5127e620c418c57b (patch)
treec140423cc3d396a8a3507496b392894cbe47fecf /client/js/controllers/home/home.js
parent6ce1bbc7be91aa6441c3ff168a734ed25479eb72 (diff)
parent85222e1246b3805100428717874d15aafd682d26 (diff)
Correct conflicts
Diffstat (limited to 'client/js/controllers/home/home.js')
-rw-r--r--client/js/controllers/home/home.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/client/js/controllers/home/home.js b/client/js/controllers/home/home.js
new file mode 100644
index 0000000..f84f625
--- /dev/null
+++ b/client/js/controllers/home/home.js
@@ -0,0 +1,36 @@
+/**
+ * The home controller
+ *
+ * @param {$scope} $scope The $scope service from angular
+ */
+mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','Identity', function ($scope, Compute, $rootScope, Loading, Identity)
+{
+
+ var callMeAfterPullData=function(data){
+ $scope.machines=Compute.getData().machines;
+ Loading.stop();
+ }
+
+ ;
+ if(Compute.getData().machines == null && Identity.isAlreadyLogin()){
+ Loading.start();
+ Compute.pullData(callMeAfterPullData);
+ }
+
+
+
+
+ $scope.raiseShowMachineDetailsEvent=function(id){
+
+ var callback=function(){
+ Loading.stop();
+ var data=Compute.getData();
+ $rootScope.$broadcast("showMachineDetailsEvent", data.machines[id], data.axioms);
+
+ }
+ Loading.start();
+ Compute.pullMachines(callback);
+ }
+
+
+}]);