This demo uses Ctrl, Shift and combination of both for multiple selection of table rows in angularJs.
For plnkr demo.
http://plnkr.co/edit/IGBCkLpmK4ecJ9RUsALa?p=preview
Html goes like this
<!DOCTYPE html>
<html ng-app="app">
<head>
<script data-require="angular.js@*" data-semver="4.0.0" src="https://code.angularjs.org/latest/angular.min.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body ng-controller="multiSelectController as vm">
{{vm.a}}
<table>
<thead>
</thead>
<tbody style="border:1px solid blue;">
<tr ng-repeat="item in vm.externalProductsTypes" ng-click="vm.selectUnselectMultiple($index,$event)" ng-class="{'selected': vm.isRowSelectedUnselect($index)}">
<td style="border:1px solid blue;">{{item.id}}</td>
<td style="border:1px solid blue;">
<div style="float:left; margin-right: 10px;">{{item.name}}</div>
</td>
</tr>
</tbody>
</table>
</body>
</html>
controller goes like this
var app = angular.module('app', []);
app.controller('multiSelectController', function() {
var vm = this;
/* Data loading */
vm.externalProductsTypes = [{
"id":1,
"name": "Access Winback"
}, {
"id":2,
"name": "ADSL",
}, {
"id":3,
"name": "Bigpond ADSL Activation",
}, {
"id":4,
"name": "Bigpond ADSL Recontracting",
}, {
"id":5,
"name": "Bigpond Cable Activation",
}, {
"id":6,
"name": "Bigpond Cable Recontracting",
}, {
"id":7,
"name": "Bigpond VAS",
}, {
"id":8,
"name": "Bigpond Wireless Activation",
}, {
"id":9,
"name": "Bigpond Wireless Recontracting",
}, {
"id":10,
"name": "Broadband Right Plan",
}];
/* click function */
vm.selectUnselectMultiple = function (idx, event) {
if (event.which != '1') {
return;
}
var row = vm.externalProductsTypes[idx];
row.rowIndex = idx;
if (!event.ctrlKey && !event.shiftKey) {
vm.clearAll();
vm.toggleRow(row);
vm.selectionPivot = row;
return;
}
if (event.ctrlKey && event.shiftKey) {
vm.selectRowsBetweenIndexes(vm.selectionPivot.rowIndex, row.rowIndex);
return;
}
if (event.ctrlKey) {
vm.toggleRow(row);
vm.selectionPivot = row;
}
if (event.shiftKey) {
vm.clearAll();
vm.selectRowsBetweenIndexes(vm.selectionPivot.rowIndex, row.rowIndex);
}
}
/* other supported functions */
vm.toggleRow = function (row) {
row.className = row.className == 's' ? '' : 's';
}
vm.selectRowsBetweenIndexes = function (ia, ib) {
var bot = Math.min(ia, ib);
var top = Math.max(ia, ib);
for (var i = bot; i <= top; i++) {
vm.externalProductsTypes[i].className = 's';
}
}
vm.clearAll = function () {
for (var i = 0; i < vm.externalProductsTypes.length; i++) {
vm.externalProductsTypes[i].className = '';
}
}
vm.isRowSelectedUnselect = function (index) {
if (vm.externalProductsTypes[index].className=='s') { // if found, then select the row.
return true;
}
}
});
finally the css for row selection
.selected {
background-color: steelblue !important;
color: white;
font-weight: bold;
}