title: How to access controller functions in directive link?
body: <p>How to access directive controller functions from directive link? Bellow controller passed to link is empty, I would like to get in it show() hide() functions.</p>
  
  <p>My current directive:</p>
  
  <pre><code>app.directive('showLoading', function() {
    return {
      restrict: 'A',
      // require: 'ngModel',
      scope: {
        loading: '=showLoading'
      },
      controller: function($scope, $element) {
        return {
          show: function() {
            alert("show");
          },
          hide: function() {
            alert("hide");
          }
        };
      },
      link: function($scope, $element, $attrs, controller) {
        $scope.$watch('loading', function(bool) {
          if (bool) {
            controller.show();//undefined
          } else {
            controller.hide();
          }
        });
      }
    };
  });
  </code></pre>