title: Can I inject a service into a directive in AngularJS?
body: <p>I am trying to inject a service into a directive like below:  </p>
  
  <pre><code> var app = angular.module('app',[]);
   app.factory('myData', function(){
       return {
          name : "myName"
       }
   });
   app.directive('changeIt',function($compile, myData){
      return {
              restrict: 'C',
              link: function (scope, element, attrs) {
                  scope.name = myData.name;
              }
          }
   });
  </code></pre>
  
  <p>But this is returning me an error <code>Unknown provider: myDataProvider</code>. Could someone please look into the code and tell me if I am doing something wrong?</p>