title: Callback function inside directive attr defined in different attr
body: <p>So I have this directive called say, <code>mySave</code>, it's pretty much just this</p>
  
  <pre><code>app.directive('mySave', function($http) {
     return function(scope, element, attrs) {
        element.bind("click", function() {
            $http.post('/save', scope.data).success(returnedData) {
                // callback defined on my utils service here
  
                // user defined callback here, from my-save-callback perhaps?
            }
        });
     }
  });
  </code></pre>
  
  <p>the element itself looks like this</p>
  
  <pre><code>&lt;button my-save my-save-callback="callbackFunctionInController()"&gt;save&lt;/button&gt;
  </code></pre>
  
  <p>callbackFunctionInController is for now just </p>
  
  <pre><code>$scope.callbackFunctionInController = function() {
      alert("callback");
  }
  </code></pre>
  
  <p>when I <code>console.log()</code> <code>attrs.mySaveCallback</code> inside my-save directive, it just gives me a string <code>callbackFunctionInController()</code>, I read <a href="https://groups.google.com/forum/?fromgroups=#!topic/angular/NGQufVevDyA" rel="noreferrer">somewhere</a> that I should $parse this and it would be fine, so I tried to <code>$parse(attrs.mySaveCallback)</code> which gave me back some function, but hardly the one I was looking for, it gave me back</p>
  
  <pre><code>function (a,b){return m(a,b)} 
  </code></pre>
  
  <p>What am I doing wrong? Is this approach flawed from the beginning?</p>