title: AngularJS - Injecting Factory into Directive's link function
body: <p>I have a simple code:</p>
  
  <pre><code>define(['app'], function(app)
  {
      app.factory('factoryProvider', function(){
          return {
              name: 'my Name'
          }
      });
  
      app.directive('myDiv',['factoryProvider', function(factoryProvider) {
          return {
              restrict: 'E',
              replace: true,
              templateUrl: 'link/to/template.html',
              controller: function($scope) {
              },
              link: function(scope, routeParams, location) {
                  console.log(factoryProvider.name);
              }
          };   
      }])
  });
  </code></pre>
  
  <p>I want to be able to access <code>myFactory</code>within the <code>link</code> function, but I can't! I also tried <code>link: function(scope, routeParams, location, factoryProvider)</code> and that also didn't work. Why?</p>