title: dynamically generate angular routes / load components
body: <p>I would like to be able to construct an Angular2 (angular 2.4) module from various dynamically loaded components attached to routes, ideally from some sort of configuration file. so that I could fire up a SPA based on this config file using components from our library. the various components/routes end up being a linear route through the application process</p>
  
  <p>for instance - config.json: - which I guess might look a bit like route config</p>
  
  <pre><code>[
  {path: 'signup', component: SignupComponent, importPath: './signup/signup.component'}
  {path: 'login', component: LoginComponent, importPath: './login/login.component'}
  ,{path: 'buyStuff', component: BuyStuffComponent, importPath: './buystuff/buystuff.component'}
  ]
  </code></pre>
  
  <p>however, as this would be dynamically generated, we have the problem of knowing that if you click the next button from signup, that you would go to the LoginComponent etc.
  equally, whatever wraps this, would presumably need all the possible imports included.</p>
  
  <p>I am not sure whether using routes to determine the dynamic components, is a better idea than trying to use the <a href="https://angular.io/docs/ts/latest/api/common/index/NgComponentOutlet-directive.html" rel="nofollow noreferrer">NgComponentOutlet</a> - unfortunately the docs for that have no examples.
  I have done a fair bit of looking around, but most of the examples appear to be using deprecated functionality.</p>
  
  <p>any help/suggestions much appreciated. </p>