Last active
August 18, 2016 08:38
-
-
Save qdouble/7a3ab66a94ec412bfc86465a4ef608f7 to your computer and use it in GitHub Desktop.
Routing to Module Components from Parent
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
@NgModule({ | |
imports: [ | |
CommonModule | |
], | |
declerations: [HomeComponent], | |
exports: [HomeComponent] | |
}) | |
export class HomeModule {} |
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
@NgModule({ | |
imports: [ | |
CommonModule | |
], | |
declerations: [LoginComponent], | |
exports: [LoginComponent] | |
}) | |
export class LoginModule {} |
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
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