From ad25c0c8ab80cecf57afa99787a0c3cb5495f170 Mon Sep 17 00:00:00 2001 From: Eric McNiece Date: Sat, 15 Oct 2016 20:51:56 -0700 Subject: [PATCH] Fixing day-schedule config/storage --- config/config.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/config.js b/config/config.js index 95675c5..c3b193c 100644 --- a/config/config.js +++ b/config/config.js @@ -43,13 +43,17 @@ app.controller('SchedulerCtrl', ['$scope', function ($scope) { return; } } - $scope.config.daySelection.push(day); + $scope.config.daySelection.push(day.value); }; $scope.isDaySelected = function (day) { + if(!$scope.config.daySelection){ + $scope.config.daySelection = []; + } + for (var i = 0; i < $scope.config.daySelection.length; i++) { var obj = $scope.config.daySelection[i]; - if (day.value === obj.value) { + if (day.value === obj) { return true; } }