title: Redirect to login page if user is in logout state, Angular2
body: <p>I am developing a single page app using AngularJS2, I want to redirect to login page if user is not login, how can I check condition for each route to check for login?</p>
  
  <pre><code>import { RouterModule, Routes } from '@angular/router';
  import { HomeComponent } from './home/home.component';
  import { LoginComponent } from './login/login.component';
  import { NotFoundComponent } from './not-found/not-found.component';
  import { SalesComponent } from './sales/sales.component';
  import { LogoutComponent } from './logout/logout.component';
  
  const appRoutes: Routes = [
    { path: 'home', component: HomeComponent },
    { path: 'login', component: LoginComponent },
    { path: 'employees', component: EmployeeComponent },
    { path: '404-not-found', component: NotFoundComponent },
    { path: 'logout', component : LogoutComponent },
    { path: '**', redirectTo: '/404-not-found' }
  ];
  
  export const routing = RouterModule.forRoot(appRoutes);
  </code></pre>
  
  <p>I want to check for login status in app.routing.ts file, and if I am not login I should redirect to login.
  Thanks for help.</p>