import { IonicModule } from '@ionic/angular';
import { RouterModule,Routes } from '@angular/router';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';

import { ShareModule } from '@share/share.module';
import { AuthGuard } from '@global/guard/auth-guard';
import {AppMenuModule} from '@widget/app/app-index-view-appmenu/app-index-view-appmenu.module';
import {AppIndexViewPage} from './app-index-view.page'


const routes: Routes = [
  {
    path: '',
    redirectTo: 'demo_appindexview',
    pathMatch: 'full'
  },
  {
    path: 'demo_appindexview',
    component: AppIndexViewPage,
    canActivate: [AuthGuard],
    data: { backendurl: '/Mob/Demo/AppIndexView.do', accessMode: 2 },
    children: [
      {
        path: '',
        redirectTo: 'appportalview',
        pathMatch: 'full',
      },
      {
        path: 'appportalview',
        children: [
          {
            path: '',
            loadChildren: '@pages/demo/app-portal-view/app-portal-view.module#AppPortalViewModule'
          }
        ]
      },

    ]
  }
];

@NgModule({
  imports: [
    RouterModule.forChild(routes)
  ],
  exports: [
    RouterModule
  ]
})
export class AppIndexViewRouteModule {}

@NgModule({
  imports: [
    IonicModule,
    CommonModule,
    FormsModule,
    ShareModule,
    AppIndexViewRouteModule,
    AppMenuModule,
  ],
  declarations: [ AppIndexViewPage]
})
export class AppIndexViewModule {}
