title: passing values to controller from directive
body: <p>I am creating a web app in which i created a directive for <code>input type file</code></p>
  
  <pre><code>app.directive('customFileInput', [function () {
          return {
              link: function (scope, element, attrs) {
                  element.on('change', function (evt) {
                      var files = evt.target.files;
                      scope.filename = files[0].name
                      console.log(scope.filename);
                  });
              }
          }
      }]);
  </code></pre>
  
  <p>this is my directive for fetching the file name from</p>
  
  <pre><code>&lt;input id="file" type="file" ng-model="mdfile" ng-change="filepath()" class="form-control"  custom-file-input /&gt;
  </code></pre>
  
  <p>this input field</p>
  
  <p>now in my controller i want to pass the filename which i get from the directive</p>
  
  <pre><code>$scope.savefunction = function () {
              var f = document.getElementById('file').files[0],
                  r = new FileReader();
              r.onloadend = function (e) {
                  $scope.data = e.target.result;
              }
              r.readAsDataURL(f);
  
              $http.get('/employeeregistration.asmx/sav', {
                  params: {
                      data: $scope.data,
                      //i want to pass the value here
                  }
              }).then(function (response) {
  
              })
          }
  </code></pre>
  
  <p>how i can pass the value</p>