Created
November 3, 2018 15:40
-
-
Save azaharafernandezguizan/d7090225ba747aa706329ef2da7c5550 to your computer and use it in GitHub Desktop.
Example of Angular´s component route.
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 { RouterModule, Routes } from '@angular/router'; | |
import { MagicalLessonsListComponent } from './magical.lessons.list.component'; | |
import { MagicaLessonsComponent } from './magical.lessons.component'; | |
import { MagicalLessonsResolver } from './magical.lessons.resolver'; | |
const routes: Routes = [ | |
{ | |
path: '', | |
component: MagicalLessonsListComponent | |
}, | |
{ | |
path: ':id', | |
component: MagicaLessonsComponent, | |
resolve: { | |
article: MagicalLessonsResolver | |
} | |
} | |
]; | |
@NgModule({ | |
imports: [RouterModule.forChild(routes)], | |
exports: [RouterModule] | |
}) | |
export class MagicalLessonsRouteModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment