import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NavTabsComponent } from './nav-tabs/nav-tabs.component';
import { PageChatComponent } from './page-chat/page-chat.component';
import { PageImagineComponent } from './page-imagine/page-imagine.component';
import { PageMineComponent } from './page-mine/page-mine.component';
import { RouterModule, Routes } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { PageRxjsComponent } from './page-rxjs/page-rxjs.component';
import { PageChatPanelComponent } from './page-chat-panel/page-chat-panel.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { PageImgHtmlComponent } from './page-img-html/page-img-html.component';
// import { PageFaceapiComponent } from './page-faceapi/page-faceapi.component';


const routes: Routes = [
  {
    // 子模块一级路由，优先加载导航组件NavTabsComponent
    // children子页面，渲染在NavTabsComponent组件的<router-outlet>路由插槽内
    path:"",component:NavTabsComponent,
    children:[
      // 当子页面路由为空，转发至默认首页chat
      {
        path:"",redirectTo:"chat",pathMatch:"full"
      },
      {
        path:"chat",component:PageChatComponent
      },
      {
        path:"chat/panel",component:PageChatPanelComponent
      },
      {
        path:"imagine",component:PageImagineComponent
      },
      // {
      //   path:"face",component:PageFaceapiComponent
      // },
      {
        path:"mine",component:PageMineComponent
      },
      {
        path:"rxjs",component:PageRxjsComponent
      },
    ]
  },
  {
    path:"chat/panel",component:PageChatPanelComponent,
  },
];

@NgModule({
  declarations: [
    NavTabsComponent,
    PageChatComponent,
    PageImagineComponent,
    PageMineComponent,
    PageRxjsComponent,
    PageChatPanelComponent,
    PageImgHtmlComponent,
    // PageFaceapiComponent
  ],
  imports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    RouterModule.forChild(routes),
    // Ionic库
    IonicModule,
  ]
})
export class AigcModule { }
