title: How can I have an external JSON data file with my route parameters in Angular2?
body: <p>I am new to Angular, and obviously Angular 2 also.  I'm trying to store my route parameters in an external file (ex., a JSON formatted data file).</p>
  
  <p>The closest I've come to getting it to work is to create a .js file with a variable set to my route parameters, and include it.</p>
  
  <pre><code>var routeParams = [
          { path: '/',             as: 'Home',          component: HomeComponent },
          { path: '/petlist',      as: 'Petlist',       component: PetlistComponent }
      ];
  </code></pre>
  
  <p>Then use it for the RouteConfig:</p>
  
  <pre><code>@RouteConfig(routeParams)
  </code></pre>
  
  <p>But the problem is that the it is expecting the components to be classes, and they don't exist in the .js file.</p>
  
  <p>I also tried having a function that returns the JSON route parameters, but I have the same issue with the component classes.</p>
  
  <p>The system I am working with already has a UI for the user to create web pages, setup menus, etc.  I am trying to have that system output Bootstrap/Angular2 templates.  Because the user can create their own web pages I'm not sure how to setup the routes since they can change.  I thought using a JSON data file would be a good solution, but my app obviously needs to use the route data from that file instead of being hard-coded in the app.</p>
  
  <p>I am using Angular 2.0.0-beta.0 and TypeScript.</p>