base-routing.module.ts 1.02 KB
Newer Older
kunw's avatar
kunw committed
1 2 3 4 5 6
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HarborShellComponent } from './harbor-shell/harbor-shell.component';

import { DashboardComponent } from '../dashboard/dashboard.component';
import { ProjectComponent } from '../project/project.component';
kunw's avatar
kunw committed
7
import { UserComponent } from '../user/user.component';
kunw's avatar
kunw committed
8

9 10
import { BaseRoutingResolver } from './base-routing-resolver.service';

kunw's avatar
kunw committed
11
const baseRoutes: Routes = [
12 13 14
  {
    path: 'harbor',
    component: HarborShellComponent,
kunw's avatar
kunw committed
15
    children: [
16 17 18 19 20 21 22
      {
        path: 'dashboard',
        component: DashboardComponent
      },
      {
        path: 'projects',
        component: ProjectComponent
kunw's avatar
kunw committed
23 24 25 26 27 28 29
      },
      {
        path: 'users',
        component: UserComponent,
        resolve: {
          projectsResolver: BaseRoutingResolver
        }
30
      }
kunw's avatar
kunw committed
31 32 33 34 35 36 37
    ]
  }];

@NgModule({
  imports: [
    RouterModule.forChild(baseRoutes)
  ],
38 39 40
  exports: [RouterModule],

  providers: [BaseRoutingResolver]
kunw's avatar
kunw committed
41 42 43 44
})
export class BaseRoutingModule {

}