title: How to call a function when its name is a string
body: <p>I have this:</p>
  
  <pre><code>    angular.module("angular-table").directive("atPagination", [
      function() {
        return {
          restrict: "E",
          scope: false,
          replace: true,
          template: paginationTemplate,
          link: function($scope, $element, $attributes) {
  
            //The function name
            let fn = '$scope.' +  $attributes.getDataFn;
            console.log($scope.$eval(fn),$attributes,$attributes.getDataFn, "$eval", fn); 
          }
      }
  }
  </code></pre>
  
  <p>I am calling the function using <code>$scope.$eval</code> in the console(last line). But the function is not getting called.</p>
  
  <p>I am trying to change this library I am using for table and pagination. I am trying to pass a function from my controller into its directive so that it gets called when next is clicked in the pagination. </p>
  
  <p>I can't pass the function the regular way because the <code>scope</code> is false and I don't want to change it. So I am passing it like this</p>
  
  <pre><code> &lt;at-pagination at-config="tableConfig" 
       get-data-fn="getPaginatedData()" at-list="personnelsdata"&gt;
   &lt;/at-pagination&gt;
  </code></pre>
  
  <p>I am trying to call the function using <code>$eval</code> but it's not working. What am I doing wrong?</p>