From 1502f547d6df08eefa28ecc78f92c6479611e915 Mon Sep 17 00:00:00 2001 From: Eraldo Hasanaj Date: Mon, 21 Jan 2019 17:19:21 +0100 Subject: [PATCH] Moved routes definition in seperate file --- src/app/app-routing.module.ts | 11 ++--------- src/app/shared/routes/index.ts | 0 src/app/shared/routes/routes.ts | 9 +++++++++ 3 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 src/app/shared/routes/index.ts create mode 100644 src/app/shared/routes/routes.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index a536dda40..2b108be34 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,13 +1,6 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { DashboardComponent } from './components/dashboard/dashboard.component'; -import { ArticleSearchComponent } from './components/article-search/article-search.component'; - -const routes: Routes = [ - {path: '', redirectTo: '/dashboard', pathMatch: 'full'}, - {path: 'dashboard', component: DashboardComponent}, - {path: 'article-search', component: ArticleSearchComponent} -]; +import { RouterModule } from '@angular/router'; +import { routes } from './shared/routes/routes'; @NgModule({ imports: [RouterModule.forRoot(routes)], diff --git a/src/app/shared/routes/index.ts b/src/app/shared/routes/index.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/app/shared/routes/routes.ts b/src/app/shared/routes/routes.ts new file mode 100644 index 000000000..352e88691 --- /dev/null +++ b/src/app/shared/routes/routes.ts @@ -0,0 +1,9 @@ +import { Routes } from '@angular/router'; +import { DashboardComponent } from 'src/app/components/dashboard/dashboard.component'; +import { ArticleSearchComponent } from 'src/app/components/article-search/article-search.component'; + +export const routes: Routes = [ + { path: '', redirectTo: '/dashboard', pathMatch: 'full' }, + { path: 'dashboard', component: DashboardComponent }, + { path: 'article-search', component: ArticleSearchComponent } +];