title: Importing a const in Angular2
body: <p>In one ts file called routes.ts I have the following const:</p>
  
  <pre><code>export const routes: RouterConfig = [
      { path: '', redirectTo: 'login', pathMatch: 'full' },
      { path: 'home', component: Home },
      { path: 'a', component: A, canActivate: [AuthGuard] },
      { path: 'b', component: B, canActivate: [AuthGuard] },
      { path: 'login', component: Login }
  ];
  </code></pre>
  
  <p>So I have another ts file with the following constructor:</p>
  
  <pre><code>constructor(http: Http, authService: AuthService) {
      authService.getRoutes();
  }
  </code></pre>
  
  <p>And in authservice.ts:</p>
  
  <pre><code>import { routes } from './../routes.ts';
  import { RouterConfig, Router } from '@angular/router';
  
  @Injectable()
  export class AuthService {
      routes: any;
      public getRoutes() : RouterConfig[] {
        debugger;
        //here I want to access and return routes
        return null;
      }
  
      constructor(private router: any) {
        this.routes = routes;
    }
  }
  </code></pre>
  
  <p>In another class I use AuthService:</p>
  
  <pre><code>@Injectable()
  export class AuthGuard implements CanActivate {
  
    constructor(private authService: AuthService, private router: Router) {
  
    }
  }
  </code></pre>
  
  <p>And in console I get the error: Cannot resolve all parameters for 'AuthGuard'(undefined, Router). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'AuthGuard' is decorated with Injectable. How do I fix this? How can I use routes in AuthService?</p>