Skip to content

Commit

Permalink
Fixed: Issue #80
Browse files Browse the repository at this point in the history
  • Loading branch information
Zohaib Hassan committed Jun 8, 2017
1 parent acede26 commit fecf6d9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions src/main/resources/static/js/controllers/packageController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/pages/packages/packages.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h1>
<table ng-table="tableParamspaginationpkg" class="table table-bordered table-striped table-hover tablesorter">
<thead>
<tr>
<td><input type="checkbox" ng-change="selectAll()" ng-model="mainCheckbox"></td>
<td><input type="checkbox" ng-change="selectAll()" ng-model="main.checkbox"></td>
<th ng-click="predicate = 'id'; reverse = !reverse">Id <i class="fa fa-sort"></i></th>
<th ng-click="predicate = 'name'; reverse = !reverse">Name <i class="fa fa-sort"></i></th>
<th ng-click="predicate = 'version'; reverse = !reverse">Version <i class="fa fa-sort"></i></th>
Expand Down

0 comments on commit fecf6d9

Please sign in to comment.