title: AngularJS dependency injection swap implementation
body: <p>I'm still learning AngularJS, and have a question regarding their flavor of dependency injection.  For example purposes, say I have a <code>DataProcessor</code> service which has a <code>processData</code> method that takes in a <code>uri</code> parameter and it needs to read that data (which may be xml, json, etc.) and then perform some actions on it.  The <code>DataProcessor</code> constructor takes in an implementation of a <code>DataReader</code> interface that knows how to read a certain file type.  Here are some example services of what I'm talking about:</p>
  
  <pre><code>// implementations of the DataReader interface
  myApp.service('XmlDataReader', function() {
      this.readData = function(uri) {
          // read xml data from uri
      }
  }]);
  
  myApp.service('JsonDataReader', function() {
      this.readData = function(uri) {
          // read json data from uri
      }
  }]);
  
  // data processing service that takes in an implementation of a DataReader
  myApp.service('DataProcessor', ['DataReader', function(DataReader) {
  
      this.processData = function(uri) {
          var readData = DataReader.readData(uri);
  
          // process data and return it
      }
  }]);
  </code></pre>
  
  <p>From a typical dependency injection perspective, a specific type of <code>DataReader</code> could be passed into the <code>DataProcessor</code> and used like so:</p>
  
  <pre><code>var dataProcessor = new DataProcessor(new JsonDataReader());
  var processedData = dataProcessor.processData('dataz.json');
  </code></pre>
  
  <p>What is the AngularJS way of doing this?</p>