Skip to content

Instantly share code, notes, and snippets.

@roelofjan-elsinga
Last active December 9, 2019 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save roelofjan-elsinga/d3542c03e4ed29b8d44f25c209d47f47 to your computer and use it in GitHub Desktop.
Save roelofjan-elsinga/d3542c03e4ed29b8d44f25c209d47f47 to your computer and use it in GitHub Desktop.
Angular routing module
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