title: How do we define a angularjs directive in a requirejs module?
body: <p>I am not exactly sure how to request and define a directive using a requirejs module.</p>
  
  <p>this is  my code for the file containing the directive directives/locationBtn.js</p>
  
  <pre><code>    define(['Zf2NVIApp'], function (Zf2NVIApp) {
      'use strict';
  
      Zf2NVIApp.directive('locationBtn', function() {
          return {
              template: '&lt;div&gt;&lt;/div&gt;',
              restrict: 'E',
              link: function postLink(scope, element, attrs) {
                  console.log("we are in the location btn module");
                  element.text('this is the locationBtn directive');
              }
          };
      });
  
  });
  </code></pre>
  
  <p>this is the code to my main.js file </p>
  
  <pre><code>require.config({
  shim: {
  },
  
  paths: {
      angular: 'vendor/angular',
      jquery: 'vendor/jquery.min',
      locationBtn: 'directives/locationBtn'
  }
  });
  
  require(['Zf2NVIApp', 'locationBtn'], function (app, locationBtn) {
  // use app here
  angular.bootstrap(document,['Zf2NVIApp']);
  });
  </code></pre>