<!doctype html>
<html ng-app="plunker">
  <head>
    <script src="https://code.angularjs.org/1.2.18/angular.js"></script>
    <script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.6.0.js"></script>
    <script src="example.js"></script>
    <script src="modalController.js"></script>
    <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
  </head>
  <body>

  <div ng-controller="ModalDemoCtrl">
      <button class="btn" ng-click="openEndTransactionDialog()">Open end transation reason!</button>
      <div ng-show="selected">Selection from a modal: {{ selected }}</div>
  </div>
  </body>
</html>
var app = angular.module('plunker', ['ui.bootstrap']);
var ModalDemoCtrl = function ($scope, $modal, $log) {

    $scope.user = {
        user: 'name',
        password: null,
        notes: null
    };

    $scope.openEndTransactionDialog = function () {
        $modal.open({
            templateUrl: 'myModalContent.html', // loads the template
            backdrop: true, // setting backdrop allows us to close the modal window on clicking outside the modal window
            windowClass: 'modal', // windowClass - additional CSS class(es) to be added to a modal window template
            controller: 'modalController',
            resolve: {
                user: function () {
                    return $scope.user;
                }
            }
        });//end of modal.open
    }; // end of scope.open function
};
app.controller('modalController', ['$scope','$log','$modalInstance','user',function ($scope, $log, $modalInstance,user) { 
  $scope.checkErrors = {
        selected:{}
      };
  $scope.errorTypes = [
      {"name":"Cash Dispensar JAM","id":"MICR"},
      {"name":"Insufficient Fund","id":"NF"},
      {"name":"No Coins","id":"NS"},
      {"name":"Server Down","id":"ND"}
    ];
    
  $scope.user = user;
  $scope.submit = function () {
      $log.log('Submiting user info.'); // kinda console logs this statement
      $log.log(user); 
      $modalInstance.dismiss('cancel'); // dismiss(reason) - a method that can be used to dismiss a modal, passing a reason
  }
  $scope.cancel = function () {
      $modalInstance.dismiss('cancel'); 
  };
}]);
<!doctype html>
<html ng-app="plunker">
  <head>
   
  </head>
  <body>
    <form ng-submit="submit()">
      <button type="button" style="float: right;" ng-click="cancel()">
        <span aria-hidden="true">&times;</span>
        <span class="hide">Close</span>
      </button>

      <div class="modal-body">
        End transaction reasons are as follows:
        
        <div ng-repeat="errortype in errorTypes">
          <label><input type="checkbox" ng-click="selectErrors(checkErrors.selected[errortype.id])" ng-model="checkErrors.selected[errortype.id]" ng-true-value="'{{errortype.name}}'" ng-false-value="''">{{errortype.name}}</label>
        </div>
        
      </div>
      <div class="modal-footer">
        <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
        <input type="submit" class="btn primary-btn" value="Submit" />
      </div>
    </form>
  </body>
</html>