Skip to content

Instantly share code, notes, and snippets.

@qdouble
Last active August 18, 2016 08:38
Show Gist options
  • Save qdouble/7a3ab66a94ec412bfc86465a4ef608f7 to your computer and use it in GitHub Desktop.
Save qdouble/7a3ab66a94ec412bfc86465a4ef608f7 to your computer and use it in GitHub Desktop.
Routing to Module Components from Parent
@NgModule({
imports: [
CommonModule
],
declerations: [HomeComponent],
exports: [HomeComponent]
})
export class HomeModule {}
@NgModule({
imports: [
CommonModule
],
declerations: [LoginComponent],
exports: [LoginComponent]
})
export class LoginModule {}
export const routes: Routes = [
{
path: 'home',
component: HomeComponent
},
{
path: 'login',
component: LoginComponent
}
];
@NgModule({
imports: [
CommonModule,
HomeModule,
LoginModule,
RouterModule.forChild(routes),
]
})
export class ParentModule {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment