0
votes

SO FAR I HAVE DONE IS

npm install ionic2-super-tabs --save

Imported in app.module.ts file

import { SuperTabsModule } from 'ionic2-super-tabs';



imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp),
    SuperTabsModule

  ],

My Tabs.html file

<super-tabs>
    <super-tab [tabRoot]="tab1Root" title="First page"></super-tab>
    <super-tab [tabRoot]="tab1Root" title="Second page"></super-tab>
    <super-tab [tabRoot]="tab1Root" title="Third page"></super-tab>
</super-tabs>

Error what i am getting

enter image description here

3
are you using lazy loading? - Suraj Rao
I have tried both - HaSnen Tai
I suspect it has to do with lazy loading and importing of the module.. anyway the library owner seems to have an example project github.com/zyra/ionic2-super-tabs-example - Suraj Rao
they are importing import { SuperTabsModule } from '../ionic2-super-tabs/src'; this gives me error module not found ../ionic2-super-tabs/src - HaSnen Tai
that maybe because they havent used library from node_modules... I think you need to use forRoot but cant be sure - Suraj Rao

3 Answers

0
votes

You should be importing the module like this instead
{ ... SuperTabsModule.forRoot(), .. }

0
votes

it's [root] instead of tabRoot

0
votes

Look this Link: https://github.com/zyra/ionic2-super-tabs/issues/269

SuperTabs doesn't use the attribute tabRoot it uses root:

Quick Example (from the docs)

<super-tabs>
  <super-tab [root]="page1" title="First page"></super-tab>
  <super-tab [root]="page2" title="Second page"></super-tab>
  <super-tab [root]="page3" title="Third page"></super-tab>
</super-tabs>

I had a lot of Problems because of the ionic2-super-tabs versions I used ionic2-super-tabs": "^4.1.4, now I'm using ionic2-super-tabs": "^4.3.0 and its runing with no BUG