title: Calling controller function from directive using bindToController
body: <p>I wrote a plunker to see how to use bindToDirective to isolate scopes and using directive controller to call main controller function, but, I am doing something wrong. Could you suggest?</p>
  
  <p>This is the plunker: <a href="http://plnkr.co/edit/UJLjTmIiHydHr8qRzAsX?p=preview" rel="nofollow">http://plnkr.co/edit/UJLjTmIiHydHr8qRzAsX?p=preview</a></p>
  
  <p>Code sample:</p>
  
  <pre><code>.controller('Ctrl', function() {
    var self = this;
    self.func = function() {
      console.log('In the controller function');
    };
  })
  
  .directive('myDirective', [ function() {
    var self = {};
    self.link = function (scope, elem, attrs, ctrl) {
        elem.bind('click', function () {
            ctrl.ctrlFunc();
        });
        elem.addClass('fa fa-file-excel-o fa-lg');
    };
    return {
        restrict: 'E',
        scope: {},
        controller: function () {
        },
        controllerAs: 'DirCtrl',
        bindToController: {
            ctrlFunc: '&amp;'
        },
        link: self.link
    };
  }])
  </code></pre>
  
  <p>html sample to associate main controller function to directive:</p>
  
  <pre><code>&lt;div ng-controller="Ctrl"&gt;
    &lt;my-directive ctrlfunc="Ctrl.func()"&gt;&lt;/my-directive&gt;
  &lt;/div&gt;
  </code></pre>