import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { Routes, RouterModule } from '@angular/router'; import { FormsModule } from '@angular/forms'; import { NgxPaginationModule } from 'ngx-pagination'; import { IndexComponent } from './index.component'; import { LayoutModule } from '../../../layouts/layout.module'; import { DefaultComponent } from '../default.component'; import { SharedModule } from '../shared.module'; // var routes: Routes = [ // { // path: '', // component: IndexComponent, // children: [] // } // ]; // if (window.location.href.indexOf('iframe') == -1) { // routes[0].path = ''; // routes[0].component = DefaultComponent; // routes[0].children = [ // { // path: '', // component: IndexComponent // } // ]; // } var routes: Routes = [ { path: '', component: DefaultComponent, children: [ { path: '', component: IndexComponent } ] } ]; @NgModule({ imports: [ CommonModule, RouterModule.forChild(routes), LayoutModule, SharedModule, FormsModule, NgxPaginationModule ], exports: [RouterModule], declarations: [IndexComponent] }) export class IndexModule {}