From 7139c2d38cb3a7c3267fc836a7e1c754388a8c7e Mon Sep 17 00:00:00 2001 From: Stefan Sterz Date: Thu, 18 Feb 2016 15:44:58 +0100 Subject: [PATCH] add front end button toggeling --- nodejs/public/javascripts/angularApp.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nodejs/public/javascripts/angularApp.js b/nodejs/public/javascripts/angularApp.js index 6b324f9..5ff2163 100644 --- a/nodejs/public/javascripts/angularApp.js +++ b/nodejs/public/javascripts/angularApp.js @@ -41,9 +41,14 @@ app.controller('MainCtrl', ['$scope', 'arduino', function ($scope, arduino){ $scope.RCs = arduino.RCs; - $scope.irTest = function(){ + for (var i = $scope.RCs.length - 1; i >= 0; i--) { + $scope.RCs[i].state = true; + } + + $scope.irTest = function(RC){ arduino.irTest(); + RC.state = (RC.state) ? false : true; };