import {Route} from '@angular/router';
import {HomeComponent} from './home/home.component';
import {LoginComponent} from './login/login.component';
import {FacebookAuthorizerComponent} from './oauth/facebook/facebook_authorizer.component';
import {FacebookTokenHandlerComponent} from './oauth/facebook/facebook_token_handler.component';
import {SignupComponent} from './signup/signup.component';
import {LoggedInGuard} from './common/logged_in_guard';
import {FeedComponent} from './feed/feed.component';
import {TopicIndexComponent} from './topic/topic-index/topic-index.component';
import {TopicDetailComponent} from './topic/topic-detail/topic-detail.component';

export const ROUTES: Route[] = [
  {
    path: '',
    component: HomeComponent
  },
  {
    path: 'login',
    component: LoginComponent
  },
  {
    path: 'signup',
    component: SignupComponent
  },
  {
    path: 'feed',
    component: FeedComponent,
    canActivate: [LoggedInGuard]
  },
  {
    path: 'topics',
    component: TopicIndexComponent,
    canActivate: [LoggedInGuard],
  },
  {
    path: 'topics/:id',
    component: TopicDetailComponent,
    canActivate: [LoggedInGuard]
  },
  {
    path: 'oauth/facebook',
    children: [
      {
        path: 'authorize',
        component: FacebookAuthorizerComponent
      },
      {
        path: 'token',
        component: FacebookTokenHandlerComponent
      }
    ]
  }
];

import {Route} from '@angular/router';
import {HomeComponent} from './home/home.component';
import {LoginComponent} from './login/login.component';
import {FacebookAuthorizerComponent} from './oauth/facebook/facebook_authorizer.component';
import {FacebookTokenHandlerComponent} from './oauth/facebook/facebook_token_handler.component';
import {SignupComponent} from './signup/signup.component';
import {LoggedInGuard} from './common/logged_in_guard';
import {FeedComponent} from './feed/feed.component';
import {TopicIndexComponent} from './topic/topic-index/topic-index.component';
import {TopicDetailComponent} from './topic/topic-detail/topic-detail.component';

export const ROUTES: Route[] = [
  {
    path: '',
    component: HomeComponent
  },
  {
    path: 'login',
    component: LoginComponent
  },
  {
    path: 'signup',
    component: SignupComponent
  },
  {
    path: 'feed',
    component: FeedComponent,
    canActivate: [LoggedInGuard]
  },
  {
    path: 'topics',
    component: TopicIndexComponent,
    canActivate: [LoggedInGuard],
  },
  {
    path: 'topics/:id',
    component: TopicDetailComponent,
    canActivate: [LoggedInGuard]
  },
  {
    path: 'oauth/facebook',
    children: [
      {
        path: 'authorize',
        component: FacebookAuthorizerComponent
      },
      {
        path: 'token',
        component: FacebookTokenHandlerComponent
      }
    ]
  },
  {
    path: '404',
    component: NotFoundComponent
  },
  {
    path: '**',
    redirectTo: '404'
  }
];

Make path for 404 in router.
Make path for 404 in router.
