title: AngularJS UI Bootstrap modal is unable to perform functions from scope
body: <p>In my angularjs app I use UI Bootstrap for creating modals. I pass scope and custom controller into the modal, it shows my data from original scope but cannot perform any of its function.
  I have main controller:</p>
  
  <pre><code>myapp.controller('WsCtrl', function WsCtrl($scope, $location, todoStorage, filterFilter, $modal, $log) {
  </code></pre>
  
  <p>In controller I have next:</p>
  
  <pre><code>$scope.items = ['item1', 'item2', 'item3'];
  $scope.open = function () {
      var modalInstance = $modal.open({
          templateUrl: 'partials/users.html',
          scope: $scope,
          controller: ModalInstanceCtrl,
          resolve: {
              items: function () {
                  return $scope.items;
              },
              users: function(){
                  return $scope.users;
              },
              CurrentDate: function(){
                  return $scope.CurrentDate;
              }
          }
      });
  
      modalInstance.result.then(function (selectedItem) {
          console.log(selectedItem);
      }, function () {
          $log.info('Modal dismissed at: ' + new Date());
      });
  };
  </code></pre>
  
  <p>And also I have another function outside the controller:</p>
  
  <pre><code>var ModalInstanceCtrl = function ($scope, $modalInstance, items) {
  
      $scope.items = items;
      $scope.users = users;
      $scope.CurrentDate = CurrentDate;
      $scope.selected = {
          item: $scope.items[0]
      };
      $scope.num = 11;
  
      $scope.ok = function () {
          $modalInstance.close($scope);
      };
  
      $scope.cancel = function () {
          $modalInstance.dismiss('cancel');
      };
  };
  </code></pre>
  
  <p>When I pass the scope to modal - I can see all my users, but I can't add one 'cause off problem with functions in my original scope.</p>