title: Angular - Decorating Directives
body: <p>I'm trying to use Angular's "decorator" capability to add functionality to some directives.  Assume that my directive's name is myDirective.  My code looks like this:</p>
  
  <pre><code>angular.module('app').config([
    '$provide', function($provide) {
      return $provide.decorator('myDirective', [
        '$delegate', '$log', function($delegate, $log) {
          // TODO - It worked!  Do something to modify the behavior
  
          $log.info("In decorator");
        }
      ]);
    }
  </code></pre>
  
  <p>]);</p>
  
  <p>I keep getting this message:</p>
  
  <pre><code>Uncaught Error: [$injector:unpr] Unknown provider: myDirectiveProvider from app 
  </code></pre>
  
  <p>To the best of my ability, the directives are already registered by the time the decorator function runs.  Any insight would be appreciated!</p>