From ffb146d63fb9b04b7a856a8ee43f10c71e54fc82 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Fri, 16 Jun 2017 17:44:00 -0400 Subject: [PATCH] setting up external router file --- src/app/app-routing.module.ts | 24 ++++++++++++++++-------- src/app/app.module.ts | 16 +--------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1f1e1ca..c2bb339 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,15 +1,23 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router';   -import { DashboardComponent } from './dashboard.component'; -import { HeroesComponent } from './heroes.component'; -import { HeroDetailComponent } from './hero-detail.component'; -  +import { AboutComponent } from './about/about.component'; +import { LinksComponent } from './links/links.component'; +import { ResumeComponent } from './resume/resume.component'; + const routes: Routes = [ - { path: '', redirectTo: '/dashboard', pathMatch: 'full' }, - { path: 'dashboard', component: DashboardComponent }, - { path: 'detail/:id', component: HeroDetailComponent }, - { path: 'heroes', component: HeroesComponent } + { + path: 'about', + component: AboutComponent + }, + { + path: 'resume', + component: ResumeComponent + }, + { + path: 'links', + component: LinksComponent + } ];   @NgModule({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 45fc342..637a2dd 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -16,21 +16,7 @@ import { RouterModule } from '@angular/router'; LinksComponent ], imports: [ - BrowserModule, - RouterModule.forRoot([ - { - path: 'about', - component: AboutComponent - }, - { - path: 'resume', - component: ResumeComponent - }, - { - path: 'links', - component: LinksComponent - } - ]) + BrowserModule ], providers: [], bootstrap: [AppComponent]