title: Where does the Angular DI useFactory() context come from?
body: <p>With angular (<a href="https://medium.com/@michelestieven/angular-writing-configurable-modules-69e6ea23ea42" rel="nofollow noreferrer">per this article</a>) <code>useFactory()</code> can be used to add decision making on what to provide the component with during DI.  Here's an example from the article:</p>
  
  <pre><code>useFactory: ()=&gt; { if( ... ) return firstObject ... }
  </code></pre>
  
  <p>My question is where does the context for the if block come from?  Since the component is not created yet, it cannot be component state ... It would be nice to see a more concrete example ...Thoughts?</p>