Ionic 3 - how to config tabs


#1

I use this in tabs.module.ts

####################################################
import { NgModule } from ‘@angular/core’;
import { IonicModule , IonicPageModule } from ‘ionic-angular’;
import { Tabs } from ‘./tabs’;

@NgModule({
declarations: [
Tabs,
],
imports: [
IonicPageModule.forChild(Tabs),
]
})
export class TabsModule {}

##################################

But not worked

ERROR
Uncaught (in promise): TypeError: WEBPACK_IMPORTED_MODULE_1_ionic_angular.a.forChild is not a function TypeError:


#2

Generated .module.ts have an additional element in the @NgModule:

  exports: [
    Tabs
  ]

Maybe this is enough?

Note that the “tabs starter” template doesn’t have a .module.ts at all:
https://github.com/driftyco/ionic2-starter-tabs/tree/master/src/pages/tabs


#3

import { NgModule } from ‘@angular/core’;
import { TabsPage } from ‘./tabs’;
import { IonicPageModule } from ‘ionic-angular’;

@NgModule({
declarations: [TabsPage],
imports: [IonicPageModule.forChild(TabsPage)],
entryComponents: [TabsPage]
})
export class TabsPageModule { }

there tabs.ts

@IonicPage({
name: ‘M_TabsPage’
})


#4

Thanks guys for your attention. The problem was solved typed
"@IonicPage()" in tabs.ts. Thank you galeio123 for tip


#5

Even it throw this error…

Cannot find module "../pages/tabs/tabs"

any Idea?


#6

Why need references?
I’m calling the page like this

this.rootPage = ‘M_TabsPage’;