title: AngularJS - pass function to directive
body: <p>I have a example angularJS</p>
  
  <pre><code>&lt;div ng-controller="testCtrl"&gt;
  
  &lt;test color1="color1" updateFn="updateFn()"&gt;&lt;/test&gt;
  &lt;/div&gt;
   &lt;script&gt;
    angular.module('dr', [])
  .controller("testCtrl", function($scope) {
      $scope.color1 = "color";
      $scope.updateFn = function() {
          alert('123');
      }
  })
  .directive('test', function() {
      return {
          restrict: 'E',
          scope: {color1: '=',
                  updateFn: '&amp;'},
          template: "&lt;button ng-click='updateFn()'&gt;Click&lt;/button&gt;",
          replace: true,
          link: function(scope, elm, attrs) { 
          }
      }
  });
  
  &lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>I want when I click button, the alert box will appear, but nothing show.</p>
  
  <p>Can anyone help me?</p>