import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
//import { LoginPage } from '../modules/user/login/login.page';
const routes: Routes = [
  {
    path: '',
    redirectTo: 'home',
    pathMatch: 'full'
  },
  {
    path: '',
    loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
  },
  {
    path:'tab1',
    loadChildren: () => import('./tab1/tab1.module').then(m => m.Tab1PageModule)
  },
  {
  path:'tab2',
    loadChildren: () => import('./tab2/tab2.module').then(m => m.Tab2PageModule)  
  },
  {
    path:'tab3',
    loadChildren: () => import('./tab3/tab3.module').then(m => m.Tab3PageModule)  
  },
  {
    path: 'login',
    loadChildren: () => import('../modules/user/login/login.module').then(m => m.LoginPageModule)
  },
  {
    path: 'edit-info',
    loadChildren: () => import('../modules/user/edit-info/edit-info.module').then(m => m.EditInfoPageModule)
  },
  // {
  //   path: 'contact',
  //   children:[
  //     {
  //       path: 'chat',
  //       loadChildren: () => import('../modules/contact/chat/chat.module').then(m => m.ChatPageModule)
  //     },
  //     {
  //       path: 'chat/:userid',
  //       loadChildren: () => import('../modules/contact/chat/chat.module').then(m => m.ChatPageModule)
  //     },
  //   ]
  // },
  {
    path: 'contact-list',
    loadChildren: () => import('./contact-list/contact-list.module').then( m => m.ContactListPageModule)
  },
  {
    path:'dynamic',
    loadChildren:()=>import('./dynamic/dynamic.module').then(m=>m.DynamicPageModule)
  }
];
@NgModule({
  imports: [
    RouterModule.forRoot(routes),
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  ],
  exports: [RouterModule]
})
export class AppRoutingModule {}
