Hi mahesh213,
Refer below code.
View
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Index</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/angular-utils-pagination@0.11.1/dirPagination.js"></script>
<script type="text/javascript">
var app = angular.module('MyApp', ['angularUtils.directives.dirPagination'])
app.controller('MyController', function ($scope, $http, $window) {
$scope.taxes = [{ Id: 1, Name: 'GST', Selected: false },
{ Id: 2, Name: 'CGST', Selected: true },
{ Id: 3, Name: 'SGST', Selected: false}];
$scope.GetChecked = function () {
var checkedId = '';
angular.forEach($scope.taxes, function (item, index) {
if (item.Selected) {
checkedId += item.Id + ",";
}
});
$scope.CId = checkedId.slice(0, checkedId.length - 1);
}
});
</script>
</head>
<body ng-app="MyApp" ng-controller="MyController">
<div class="well">
<div class="form-horizontal">
<div class="row">
<div class="col-md-3">
<label for="Name">
Order Name</label>
<input type="text" id="Name" class="form-control" ng-model="JobName" />
</div>
<div class="col-md-3">
<label for="Job Type">
Description</label>
<button type="button" class="btn btn-primary btn-sm" ng-init="clicked=false" ng-click="clicked=!clicked">
View Orders
</button>
</div>
<div class="col-md-3">
<label for="Name">
Checkbox Id</label>
<input type="text" id="CId" class="form-control" ng-model="CId" />
</div>
</div>
<div class="modal fade in" aria-hidden="false" style="display: block;" ng-show="clicked">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" ng-click="clicked=false">
×
</button>
<h4 style="margin-left: 15px; text-align: center;">
Subitem Details</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<fieldset>
<!-- Form Name -->
<label style="margin-left: 25px;" ng-repeat="o in taxes" class="checkbox">
<input type="hidden" ng-model="o.Id" />
<input type="checkbox" name="subject" ng-checked="{{o.Selected}}" ng-model="o.Selected" />{{o.Name}}
</label>
</fieldset>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" ng-click="clicked=false;GetChecked();">
Ok
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Screenshot