title: How can we pass variable in isolated scope function
body: <p>I have a directive like below -</p>
  
  <pre><code>&lt;div data-my-param-control data-save-me="saveMe()"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>In directive controller, I bind saveMe() function from controller with isolated scope &amp; like below - </p>
  
  <pre><code>function MyParamControlDirective($filter,
                                   $state,
                                   $stateParams,
                                   $uibModal,
                                   ) {
  return {
      restrict: 'AE',
      scope: {
          saveMe: '&amp;',         
      },
      templateUrl: 'html/myhtml',
      controller: ['$scope', function ($scope) {  
              $scope.saveMeHandler = function () {
              var saveMe = $scope.saveMe();
              $uibModal.open({
                  animation: false,
                  windowTopClass: '',
                  templateUrl: 'html/askmyname',
                  size: 'sm',       
                  resolve: {
                      saveMe: function () {
                          return saveMe;
                      }
                  },                         
                  controller: function (
                                          $scope,                                         
                                          $uibModalInstance,
                                          saveMe,                                         
                                          toastr                                 
                                        ) 
                  {                    
  
                      $scope.close = function () {                            
                          $uibModalInstance.close();
                      };                        
                      $scope.saveMyName = function() {
                          $scope.submited =  true;                           
                          if ($scope.my_name != "undefined" &amp;&amp; $scope.my_name != "") {                                                                
                              saveMe();
                              $scope.close();
                          } else {
                              toastr.error('Please enter search name');
                          }                        
                      }                        
                  }
              });               
          };           
      }]
  };
  </code></pre>
  
  <p>}</p>
  
  <p>Everything is working fine till now. </p>
  
  <p>I added a uibModal in directive and open a popup to get a name. the name comes in $scope.my_name variable. Now I want to pass this name in function saveMe(). If I directly pass variable like saveMe($scope.my_name); it shows undefined in controller function. Below is the controller function - </p>
  
  <pre><code>$scope.saveMe = function () {
      //logic here to save data
  };
  </code></pre>
  
  <p>Can you guys help me how can I pass my_name from modal to saveMe method. Thanks in advance</p>