title: angularjs directive Argument 'fn' is not a function
body: <p>I am using angularjs and typescript where i am trying to create a directive as following:</p>
  
  <p>Here is my controller :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export const test1 = {
      template: require('./app.html'),
      controller($scope, $http) {
   
               $scope.hello =  "hello app";
  
      }
  };</code></pre>
  </div>
  </div>
  </p>
  
  <p>I know how to create a directive using javascript, but how to do it using a const then import it.</p>
  
  <p>Here is my directive in js:</p>
  
  <pre><code>export const myDirective = {
      directive() {
          return {
          restrict : "A",
          template : "&lt;h1&gt;Made by a directive!&lt;/h1&gt;"
      };
  
      }
  };
  </code></pre>
  
  <p>My View:</p>
  
  <pre><code>&lt;div class="container"&gt;
  &lt;div class="row"&gt;
      &lt;div ng-repeat="b in data"&gt;
         &lt;div my-directive&gt;&lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div&gt;
  </code></pre>
  
  <p>I am trying to import it and use as:</p>
  
  <pre><code>import angular from 'angular';
  import {ngAnimate} from 'angular-animate';
  import {ngSanitize} from 'angular-sanitize';
  import 'angular-ui-bootstrap';
  
  import 'angular-ui-router';
  import routesConfig from './routes';
  
  import {hello} from './app/hello';
  import {test1} from './test1/app';
  import { myDirective} from './test1/directives'
  
  import './index.scss';
  
  export const app = 'app';
  
  angular
    .module(app, ['ngAnimate', 'ngSanitize','ui.router', 'ui.bootstrap'])
    .config(routesConfig)
    .component('app', hello)
    .component('test1', test1)
    .directive('myDirective', myDirective ) ;
  </code></pre>
  
  <p>However i am getting this error:</p>
  
  <pre><code>Error: [ng:areq] Argument 'fn' is not a function, got Object
  </code></pre>