JSFiddle - React, Tailwind, and code Playground
by RobbyD
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js"></script>
<div ng-controller="Controller1">
<input type="submit" ng-click="sendToBackend()">
{{name}}
<table>
<thead><tr><td>Select</td><td>Customer</td></tr>
</thead>
<tbody>
<tr ng-repeat="demo in demos">
<td><input type="checkbox" ng-click="addToList(demo.Custid)"></td>
<td>{{demo.Custid}}</td>
</tr>
</tbody>
</table>
<ul>
<li ng-repeat="check in checkboxes">{{check}}</li>
</ul>
</div>
JavaScript
var myApp = angular.module('myApp', [])
myApp.controller('Controller1', ['$scope',function($scope) {
$scope.name = 'Controller1';
$scope.checkboxes = [];
$scope.demos = [{
Account: 'abc.com',
Custid: 125000,
}, {
Account: 'abc.com',
Custid: 125001,
}, {
Account: 'abc.com',
Custid: 125002,
}];
$scope.addToList = function(id) {
$scope.checkboxes.push(id);
};
$scope.sendToBackend = function() {
alert("sending " + $scope.checkboxes.length + " items to backend");
};
}]);