Last active
December 9, 2019 14:23
-
-
Save roelofjan-elsinga/d3542c03e4ed29b8d44f25c209d47f47 to your computer and use it in GitHub Desktop.
Angular routing module
This file contains hidden or 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 {HomeComponent} from './home/home.component'; | |
import {AboutUsComponent} from './about-us/about-us.component'; | |
import {ContactComponent} from './contact/contact.component'; | |
import {UIRouterUpgradeModule} from "@uirouter/angular-hybrid"; | |
export const StaticPagesRoutes = { | |
states: [ | |
{ | |
name: 'home', | |
url: '/', | |
component: HomeComponent, | |
parent: 'public' | |
}, | |
{ | |
name: 'aboutus', | |
url: '/about-us', | |
component: AboutUsComponent, | |
parent: 'public' | |
}, | |
{ | |
name: 'contact', | |
url: '/contact', | |
component: ContactComponent, | |
parent: 'public' | |
} | |
] | |
} | |
@NgModule({ | |
imports: [ | |
CommonModule, | |
SharedModule, | |
UIRouterUpgradeModule.forChild(StaticPagesRoutes) | |
], | |
declarations: [ | |
HomeComponent, | |
AboutUsComponent, | |
ContactComponent | |
] | |
}) | |
export class StaticPagesModule { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment