import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';

import { IonicModule } from '@ionic/angular';

import { Routes, RouterModule } from '@angular/router';

import { TabnavPageRoutingModule } from './tabnav-routing.module';

import { TabnavPage } from './tabnav.page';

const routes: Routes = [
  {
    path: 'tabs-nav',
    component: TabnavPage,
    children: [
      {
        path: 'dashboard',
        loadChildren: () => import('../dashboard/dashboard.module').then(m => m.DashboardPageModule)
      },
      {
        path: 'lights',
        loadChildren: () => import('../lights/lights.module').then(m => m.LightsPageModule) 
      },
      {
        path: 'sunblinds',
        loadChildren: () => import('../sunblinds/sunblinds.module').then(m => m.SunblindsPageModule)
      },
      {
        path: 'airconditioning',
        loadChildren: () => import('../airconditioning/airconditioning.module').then(m => m.AirconditioningPageModule)
      }
    ]
  },
  {
    path: '',
    redirectTo: '/tabs-nav/dashboard'
  }
];

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule,
    TabnavPageRoutingModule,
    RouterModule.forChild(routes)
  ],
  declarations: [TabnavPage]
})
export class TabnavPageModule {}
