Skip to content

Commit

Permalink
Routing and Navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
amejiarosario committed Oct 18, 2016
1 parent 161be3b commit 4a7f715
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<app-todo></app-todo>
<router-outlet></router-outlet>
9 changes: 8 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { Routes, RouterModule } from '@angular/router';

import { AppComponent } from './app.component';
import { TodoComponent } from './todo/todo.component';

const routes: Routes = [
{ path: ':status', component: TodoComponent },
{ path: '**', redirectTo: '/all' }
];

@NgModule({
declarations: [
AppComponent,
Expand All @@ -14,7 +20,8 @@ import { TodoComponent } from './todo/todo.component';
imports: [
BrowserModule,
FormsModule,
HttpModule
HttpModule,
RouterModule.forRoot(routes)
],
providers: [],
bootstrap: [AppComponent]
Expand Down

0 comments on commit 4a7f715

Please sign in to comment.