title: AngularJS directives erroring out - Cannot read property 'compile' of undefined
body: <p>Newbie to AngularJS and trying to create a simple directive. The code fails with a 
  TypeError: Cannot read property 'compile' of undefined. Any suggestions would be greatly appreciated. </p>
  
  <p><strong>JS</strong></p>
  
  <pre><code>var xx = angular.module('myApp', []);
  xx.directive('myFoo', 
               function(){
                   return 
                   {
                       template:'23'
                   };                     
  });
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div ng-app="myApp"&gt;
  &lt;div my-foo&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>You can find the code and error here <a href="https://jsfiddle.net/p11qqrxx/15/">https://jsfiddle.net/p11qqrxx/15/</a></p>