title: Angular directive this undefined
body: <p>Why am I getting and <code>undefined</code> when I console out <code>this</code> in this Angular directive? </p>
  
  <pre><code>(function() {
    'use strict';
  
    function ExampleDirective() {
      var self = this;
  
      // returns undefined
      console.log(self);
  
      return {};
    }
  
    angular
      .module('example')
      .directive('exampleDirective', ExampleDirective);
  
  })();
  </code></pre>