title: Passing Data to Twitter Bootstrap Modal in Angular
body: <p>I want to show a modal box asking the user if they want to delete a post or not. I can't figure out how to pass the key which I pass in the key argument in which I also can alert. </p>
  
  <p>I took the code from the angular twitterbootstrap site but I can't figure out a method to pass data to confirm the remove. </p>
  
  <p>Thanks
  Mohammad</p>
  
  <pre><code>$scope.deletePost = function(key, post, event) {
      alert(key);
      var modalInstance = $modal.open({
          templateUrl: 'deletePost.html',
          controller: ModalInstanceCtrl,
          resolve: {
              items: function() {
                  return $scope.posts;
              }
          },
      })
  
      modalInstance.result.then(function(selectedItem) {
          $scope.selected = selectedItem;
          alert(selectedItem);
      });
  };
  
  
  var ModalInstanceCtrl = function($scope, $modalInstance, items) {
      $scope.items = items;
      $scope.selected = {
          item: $scope.items[0]
      };
      $scope.ok = function() {
          $modalInstance.close($scope.selected.item);
      };
  
      $scope.cancel = function() {
          $modalInstance.dismiss('cancel');
      };
  };
  </code></pre>