title: Access scope on specific fuinction in AngularJS
body: <p>I have a following ambiguity in AngularJS. 
  I'm using AngularJS ui Modal and provide 
  controller about this modal. From this controller
  I want to access variable from other scope. What is 
  a angular way to do this? Here is my code: </p>
  
  <pre><code>   controllers.controller('ResultCtrl', ['$scope', '$routeParams', '$http', '$q', 'Matches', '$modal',
          function ($scope, $routeParams, $http, $q, Matches, $modal) {
  
              /**
               * other code
               * 
               * from this scope i can access 
               * $scope.terms
               */
              $scope.mergeTerms = function() {
                  var ModalInstanceCtrl =  function ($scope, $modalInstance) {
                      /**
                       * Here I want to access 
                       * $scope.terms as a above 
                       * function
                       */
                  }
              }
  
          });
  </code></pre>
  
  <p>Best regards. </p>