From fecf6d9e986f875a0b791dcf218eea7f74d69f75 Mon Sep 17 00:00:00 2001 From: Zohaib Hassan Date: Thu, 8 Jun 2017 18:05:33 +0200 Subject: [PATCH] Fixed: Issue #80 --- .../static/js/controllers/packageController.js | 17 ++++++++++++++--- .../static/pages/packages/packages.html | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/resources/static/js/controllers/packageController.js b/src/main/resources/static/js/controllers/packageController.js index 9d76070fe..39d42da01 100644 --- a/src/main/resources/static/js/controllers/packageController.js +++ b/src/main/resources/static/js/controllers/packageController.js @@ -100,9 +100,20 @@ app.controller('PackageCtrl', function ($scope, serviceAPI, $routeParams, http, $scope.selection.ids = {}; }; - $scope.$watch('mainCheckbox', function (newValue, oldValue) { - //console.log(newValue); - //console.log($scope.selection.ids); + $scope.main = { checkbox: false }; + + $scope.selectAll = function() { + var newValue = $scope.main.checkbox; + angular.forEach($scope.selection.ids, function (value, k) { + /* console.log(k); + console.log(value);*/ + + $scope.selection.ids[k] = newValue; + }); + } + $scope.$watch('main', function (newValue, oldValue) { + console.log(newValue); + console.log($scope.selection.ids); angular.forEach($scope.selection.ids, function (value, k) { diff --git a/src/main/resources/static/pages/packages/packages.html b/src/main/resources/static/pages/packages/packages.html index f5c2eb39d..a2d13f9f7 100644 --- a/src/main/resources/static/pages/packages/packages.html +++ b/src/main/resources/static/pages/packages/packages.html @@ -47,7 +47,7 @@

- +
Id Name Version