title: Angular bootstrap ui modal with same controller instead of new controller
body: <p>I am using angular bootstrap ui modal box it says to give a new $modalInstance for new controller.I want to use the same controller where i have initialized the modal box.I searched but no success.I found this links but no success - </p>
  
  <p><a href="https://stackoverflow.com/questions/23780950/how-to-use-the-same-controller-for-modal-and-non-modal-form-in-angular-ui-bootst">How to use the same controller for modal and non-modal form in Angular UI Bootstrap?</a>
  <a href="https://stackoverflow.com/questions/23756105/angular-ui-bootstrap-modal-without-creating-new-controller">Angular-ui bootstrap modal without creating new controller</a></p>
  
  <pre><code>app.controller('UserCtrl',['$scope','$filter','ngTableParams','$modal',function($scope, $filter, ngTableParams,$modal) {
  
    var modalInstance = $modal.open({
    templateUrl: 'myModalContent.html',
    controller: 'ModalInstanceCtrl', //Instead of this i want to use the same controller 'UserCtrl'
    size: size,
    resolve: {
      items: function () {
        return $scope.items;
      }
    }
  });
  
  modalInstance.result.then(function (selectedItem) {
    $scope.selected = selectedItem;
  }, function () {
    $log.info('Modal dismissed at: ' + new Date());
  });
   };
  };
  
    } ]);
  </code></pre>
  
  <p>So that i can call the save function on this same controller which is called on save click of modal box</p>