title: dynamic provider options through app config AngularJS
body: <p>I have provider modules that accept configurations like:</p>
  
  <pre><code>angular.module('app', ['search']).
    config(['$searchProvider', function($searchProvider) {
      $searchProvider.options({
        resultLimit:50,
        defaultSort:'highToLow'
      });
    }]);
  </code></pre>
  
  <p>There will be a new app instantiation per client --- so I am thinking about using a client self serve portal to configure <code>meta</code> object.</p>
  
  <p>This means the provider modules now need to sit inside a callback method to wait for <code>meta</code> before they can set their respective configurations.</p>
  
  <p>But let's all remember: <strong>Configuration blocks</strong> - get executed during the provider registrations and configuration phase. Only providers and constants can be injected into configuration blocks. This is to prevent accidental instantiation of services before they have been fully configured...</p>
  
  <p>...So the docs say you can use provider in configuration blocks, but I'm not sure you can use them to make service calls. Because I have no idea how to handle this the right way, I will show you my "high level" idea: </p>
  
  <p><strong>Wrap dependant providers with another provider callback:</strong></p>
  
  <pre><code>angular.module('app', ['search','meta']).
    config(['$searchProvider','$metaProvider', function($searchProvider, $metaProvider) {
      $metaProvider.get(function(meta){
        $searchProvider.options(meta);
      });
    }]);
  </code></pre>
  
  <p>What's the best way to handle this?</p>