title: Injecting a resolved promise into service
body: <p>I need to get some information (a schema) from the server before I set up a bunch of services that depend on that information.</p>
  
  <p>My server provides a schema that defines various properties of a model.  In my angular code, I have a service that gets this schema:</p>
  
  <pre><code>services.factory('schema', function($q, $http) {
      var deferred = $q.defer();
          $http.get('schema/').then(function(response) {
          schema = // some function of response.data
          deferred.resolve(schema);
      }, function() {
          deferred.reject('There was a problem fetching the schema');
      }); 
          return deferred.promise;
  });
  </code></pre>
  
  <p>I would like to inject the schema object, and not the promise, into other services that depend on the schema.  $routeProvider lets us do this for controllers:</p>
  
  <pre><code>app.config(function($routeProvider) {
      $routeProvider.
          when('/', {
              controller: 'SomeCtrl',
              resolve: {
                  schema: 'schema'
              },
              ...
          });
  });
  </code></pre>
  
  <p>and this allows me to define SomeCtrl like this:</p>
  
  <pre><code>controllers.controller('SomeCtrl', function($scope, schema) {
      // schema is an object
      ...
  });
  </code></pre>
  
  <p>But for services, I have to do:</p>
  
  <pre><code>services.factory('SomeService', function(schema) {
      // schema is a promise
      schema.then(function(schema) {
          ...
      });
  });
  </code></pre>
  
  <p>Is there any way I can do this?</p>