title: Angularjs (Typescript) directive link function not firing
body: <p>I recently started learning Typescript and I have an issue creating a directive. the factory method is executed, but the link function is not. i don't know if this is a structural problem or something else.</p>
  
  <p>This is my directive:</p>
  
  <pre><code>namespace app {
  'use strict';
  
  class MyDirective implements ng.IDirective{
      restrict: string = 'A';
  
      constructor(private $compile: ng.ICompileService, private $templateRequest: ng.ITemplateRequestService, private logger: blocks.logger.Logger) {}
  
      static factory(): ng.IDirectiveFactory {
          var directive = ($compile: ng.ICompileService, $templateRequest: ng.ITemplateRequestService, logger: blocks.logger.Logger) =&gt;new MyDirective($compile, $templateRequest, logger);
          directive.$inject = ['$compile', '$templateRequest', 'logger'];
          return directive;
      }
  
      link = (scope: ng.IScope, element: ng.IAugmentedJQuery) =&gt; {
  
          scope.$on('$stateChangeStart',() =&gt; {
              //more code ...
          });
  
          scope.$on('$viewContentLoaded', ():void =&gt; {
              //more code...
          });
      }
  }
  
  angular
      .module('app')
      .directive('myDirective', MyDirective.factory);
  }
  </code></pre>
  
  <p>Thanks in advance!</p>