title: $provide.decorator giving unknown provider for directives
body: <p>I am lazy loading modules dependent on the user. And then i wan't to declare a decorator for the directives being loaded with the module. But i am getting unknown provider when trying to decorate a directive.</p>
  
  <pre><code>angular.module(moduleName).config(function ($provide) {
      var invokeQueue = angular.module(moduleName)._invokeQueue;
      invokeQueue.forEach(function (service) {
          if(service[1] === 'directive'){
              var directive = service[2][0];
              $provide.decorator(directive, function ($delegate) {
                  return $delegate;
              })
          }
      });
  });
  </code></pre>
  
  <p>var directive is the directive name and is being set.</p>
  
  <p>error</p>
  
  <blockquote>
    <p>[$injector:unpr] Unknown provider: demoDirectiveProvider</p>
  </blockquote>
  
  <p>If i change the code to take services or factories instead it works. </p>
  
  <p>Both of the following works</p>
  
  <pre><code>if(service[1] === 'service')
  if(service[1] === 'factory')
  </code></pre>
  
  <p>any suggestions to why this wan't work with directives</p>