Last active
March 29, 2017 06:23
-
-
Save fredrik-lundin/aae47a71589c46d9944b428212acf568 to your computer and use it in GitHub Desktop.
Routing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule } from '@angular/core'; | |
import { Routes, RouterModule } from '@angular/router'; | |
import { BlueComponent } from 'app/blue/blue.component'; | |
import { RedComponent } from 'app/red/red.component'; | |
const routes: Routes = [ | |
{ | |
path: '', | |
children: [ | |
{ | |
path: 'red', | |
component: RedComponent | |
}, | |
{ | |
path: 'blue', | |
component: BlueComponent | |
}, | |
] | |
}, | |
{ | |
path: '**', | |
redirectTo: '/' | |
} | |
]; | |
@NgModule({ | |
imports: [RouterModule.forRoot(routes)], | |
exports: [RouterModule] | |
}) | |
export class AppRoutingModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment