title: AngularJS; Send a function from the parent into directive scope
body: <p>I'm creating a reusable component/widget as a directive using a template and isolated scope. I'd like to be able to also send a callback into the directive and call it in the widget. Is this possible?
  Something like...</p>
  
  <p>mainView template:
  <code>&lt;my-widget callback="someFunction"&gt;&lt;/my-widget&gt;</code></p>
  
  <p>directive:</p>
  
  <pre><code>return {
      restrict: 'E',
      scope: {
          callback: '='
      },
      templateUrl: '/partials/widget.html',
  }
  </code></pre>
  
  <p>And the template:</p>
  
  <pre><code>&lt;input type="text" ng-change="callback()" /&gt;
  </code></pre>
  
  <p>So when the widget value is changed, it triggers the callback function that was passed in the main view</p>