title: Angular 2 - Is it possible to store my routes in another file and import them into the app.ts file (because over time the routes will build up)?
body: <p>Angular 2 - Is it possible to store my routes in another file and import them into the app.ts file (because over time the routes will build up)</p>
  
  <p>Here is an example of my current app.ts that works. I basically want to move the route config routes to another file to make it cleaner:</p>
  
  <pre><code>   import {Todo} from './components/todo/todo';
     import {About} from './components/about/about';
     import {AuthService} from './authService';
  
     import {Component, View, bootstrap, bind, provide} from 'angular2/angular2';
     import {Router, ROUTER_BINDINGS, RouterOutlet, RouteConfig, RouterLink, ROUTER_PROVIDERS, APP_BASE_HREF} from 'angular2/router';
     import {Location, LocationStrategy, HashLocationStrategy} from 'angular2/router';
  
     @Component({
         selector: 'app'
     })
  
     @View({
         template: `
             &lt;div class="container"&gt;
                 &lt;nav&gt;
                     &lt;ul&gt;
                         &lt;li&gt;&lt;a [router-link]="['/Home']"&gt;Todo&lt;/a&gt;&lt;/li&gt;
                         &lt;li&gt;&lt;a [router-link]="['/About']"&gt;About&lt;/a&gt;&lt;/li&gt;
                     &lt;/ul&gt;
                 &lt;/nav&gt;
                 &lt;router-outlet&gt;&lt;/router-outlet&gt;
             &lt;/div&gt;
         `,
         directives: [RouterOutlet, RouterLink]
     })
  
     @RouteConfig([
         { path: '/', redirectTo: '/home' },
         { path: '/home', component: Todo, as: 'Home' },
         { path: '/about', component: About, as: 'About' }
     ])
  
     export class AppComponent {
         constructor(router: Router, _authService: AuthService, _location: Location){
  
             //Subscribe - watches routes pop state events.
             router.subscribe((val) =&gt; {      
  
                 _authService.isUserLoggedIn().then((success) =&gt; {                 
                     router.parent.navigate(['/About']);
                 });
  
             })       
         }
     }
  
     bootstrap(AppComponent, [ROUTER_PROVIDERS, provide(APP_BASE_HREF, {useValue: '/'}), AuthService]);
  </code></pre>