I'm trying to get selected rows from table in AngularJS, but not able to figure out how to do that. Below is the plunker to see what I did.
http://plnkr.co/edit/APb0MeK5th7z79l32SEy?p=preview
Code Html
<body ng-controller="MainCtrl">
<table>
<tr><td>Select Column</td><td>id</td> <td>name</td> <td>address</td> <td>classA</td> <td>classB</td></tr>
<tr ng-repeat="employee in employees">
<td><input type="checkbox"></td>
<td>{{employee.id}}</td>
<td>{{employee.name}}</td>
<td>{{employee.address}}</td>
<td><input type="checkbox" ng-model="employee.classA"></td>
<td><input type="checkbox" ng-model="employee.classB"></td>
</tr>
</table>
<input type="button" name="save" value="submit">
Code JS
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.employees = [
{ id:"1", name: "A", address: "A1", classA: true, classB: true },
{ id:"2", name: "B", address: "A2", classA: false, classB: true },
{ id:"3", name: "C", address: "A3", classA: true, classB: false },
{ id:"4", name: "D", address: "A4", classA: false, classB: true },
{ id:"5", name: "E", address: "A5", classA: false, classB: true },
];
});
I want the rows which are selected by user from left column check box while they click on submit.
Help is appreciated.