diff options
| author | ARC <arjunrc@gmail.com> | 2015-04-25 15:11:33 -0400 |
|---|---|---|
| committer | ARC <arjunrc@gmail.com> | 2015-04-25 15:11:33 -0400 |
| commit | 18b05289d8042b602054a46a8b7f78667e15a1df (patch) | |
| tree | cf80d1183b5f12e35ebd15158e3d947041584519 /www/js/MontageCtrl.js | |
| parent | cd467c329d6c7f97b549bad965f69f95a8b487af (diff) | |
Comments added
Diffstat (limited to 'www/js/MontageCtrl.js')
| -rw-r--r-- | www/js/MontageCtrl.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 115bd513..8a189dfb 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -1,3 +1,5 @@ +// Controller for the montage view + angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', function ($scope, $rootScope, ZMDataModel, message,$ionicSideMenuDelegate) { @@ -8,24 +10,26 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', function ($s //var monsize =3; console.log("********* Inside Montage Ctrl"); $scope.LoginData = ZMDataModel.getLogin(); + + // slider is tied to the view slider for montage + //Remember not to use a variable. I'm using an object + // so it's passed as a reference - otherwise it makes + // a copy and the value never changes $scope.slider = {}; $scope.slider.monsize = ZMDataModel.getMontageSize(); $scope.$on('$ionicView.afterEnter', function () { + // This rand is really used to reload the monitor image in img-src so it is not cached + // I am making sure the image in montage view is always fresh $rootScope.rand = Math.floor((Math.random() * 100000) + 1); - //console.log("*********IN VIEW, generated " + $rootScope.rand); - console.log("Rootscoxxpe Montage is " + ZMDataModel.getMontageSize() + " and slider montage is " + $scope.slider.monsize); }); - - - $scope.$watch('slider.monsize', function () { console.log('Slider has changed'); ZMDataModel.setMontageSize($scope.slider.monsize); console.log("Rootscope Montage is " + ZMDataModel.getMontageSize() + " and slider montage is " + $scope.slider.monsize); - //$rootScope.montageSize = $scope.slider.monsize; + }); $scope.monitors = []; @@ -33,11 +37,6 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', function ($s $scope.monitors = message; console.log("I have received the monitors inside Montage and there are " + $scope.monitors.length); - // console.log("***CALLING FACTORY"); - //ZMHttpFactory.getMonitors().then(function(data) //{ - // $scope.monitors = data; - // console.log("I GOT " + $scope.monitors); - // }); $scope.doRefresh = function () { console.log("***Pull to Refresh"); @@ -50,4 +49,4 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', function ($s }); }; -});
\ No newline at end of file +}); |
