app-routing.module.ts 1.75 KB
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './pages/login/login.component';
import { InfoComponent } from './pages/info/info.component';

/* const appRoutes: Routes = [
  {
    path: 'user',
    children: [
      {path: '', component: UserMenuComponent, outlet: 'left-menu'},
      {path: '', pathMatch: 'full', component: UserComponent},
      {path: 'old', component: OldMoyaComponent},
    ]
  },
  {
    path: 'info',
    children: [
      {path: '', component: InfoMenuComponent, outlet: 'left-menu'},
      {path: '', pathMatch: 'full', component: OldMoyaComponent},
      {path: 'old', component: OldMoyaComponent},
      {path: 'viplist', component: ViplistComponent},
    ]
  },
  {
    path: 'admin',
    children: [
      {path: '', component: AdminMenuComponent, outlet: 'left-menu'},
      {path: '', pathMatch: 'full', component: AdminComponent},
      {path: 'old', component: OldMoyaComponent},
    ]
  },

  {path: 'old', pathMatch: 'prefix', component: OldMoyaComponent},
]; */

const APP_ROUTES: Routes = [
  { path: 'info', loadChildren: 'app/pages/info/info.module#InfoModule' },
  { path: 'admin', loadChildren: 'app/pages/admin/admin.module#AdminModule' },
  { path: 'user', loadChildren: 'app/pages/user/user.module#UserModule' },
  { path: 'login', component: LoginComponent },
  { path: '', pathMatch: 'full', redirectTo: 'login' },
  { path: '**', component: LoginComponent }
]; 

@NgModule({
  imports: [
    RouterModule.forRoot(
      APP_ROUTES,
/*       {
        enableTracing: true, // <-- debugging purposes only

      } */
    )
  ],
  exports: [
    RouterModule
  ],
  providers: [
  ]
})
export class AppRoutingModule { }