Skip to content

Instantly share code, notes, and snippets.

@johan--
Forked from roelofjan-elsinga/static.routes.ts
Created December 9, 2019 14:23
Show Gist options
  • Save johan--/340687c990547e53d92f478c0bd6a0e3 to your computer and use it in GitHub Desktop.
Save johan--/340687c990547e53d92f478c0bd6a0e3 to your computer and use it in GitHub Desktop.

Revisions

  1. @roelofjan-elsinga roelofjan-elsinga renamed this gist Jul 22, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @roelofjan-elsinga roelofjan-elsinga created this gist Jul 22, 2018.
    43 changes: 43 additions & 0 deletions routes.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    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 {
    }