title: angular-fullstack directive causes Error: [$injector:unpr]
body: <p>I've got an angular-fullstack project that I've been working on. Everything has been working fine, until I tried to make a directive. At first I thought my directive was too complex, but I've since tried with a stock, generated directive and I'm still getting the same error. </p>
  
  <p>Directive is here:</p>
  
  <pre><code> 'use strict';
  
   angular.module('angularApp')
        .directive('test', function () {
          return {
            templateUrl: 'app/test/test.html',
            restrict: 'EA',
            link: function (scope, element, attrs) {
            }
          };
        });
  </code></pre>
  
  <p>I inject it here in main.js</p>
  
  <pre><code>'use strict';
  
  angular.module('angularApp')
    .controller('MainCtrl', function ($scope, $http, socket, characterService, test) {
      $scope.path = new Array();
      $scope.heroes = new Array();
  
      characterService.all().success(function(data) {
        $scope.heroes = data;
      });
  
    });
  </code></pre>
  
  <p>Everything works fine as long as I don't have test in the list of injected stuff, but if it's there, I get the error. </p>
  
  <p>angular.js:11607Error: [$injector:unpr] Unknown provider: testProvider &lt;- test &lt;- MainCtrl</p>
  
  <p>Is there somewhere else I need to add it? I've tried adding it to the dependency list like this:</p>
  
  <pre><code>angular.module('angularApp')
        .controller('MainCtrl', ['test', function ($scope, $http, socket, characterService, test)
      ...
  </code></pre>
  
  <p>But that doesn't seem to make any difference.</p>