Tab Swipe ionic


#1

Hi,

I wanted to do tab swipe in ion-tabs.

After various attempts, finally I tried a method,

<ion-content (swipe)=“swipeEvent($event)” >

swipeEvent(e){
if(e.direction==2)
this.navCtrl.parent.select(2);
if(e.direction==4)
this.navCtrl.parent.select(0);
}

It is working with browser but not in the device. How to make my ion-tabs swipe to move to next/previous tabs


#2

You can use the (unofficial) super tabs module.


#3

I tried super tabs but it doesn’t work out for me. Can you please share me any working example or some pieces of code? I mean, what changes I’ve to make on ion-tabs


#4

There is an example app by the creator of the module on github. You won’t need to make any changes to ion-tabs, you should use super-tabs and super-tab instead of ion-tabs and ion-tab.


#5

I’m getting below error

ERROR Error: Uncaught (in promise): Error: StaticInjectorError[SuperTabsController]:
StaticInjectorError[SuperTabsController]:
NullInjectorError: No provider for SuperTabsController!
Error: StaticInjectorError[SuperTabsController]:
StaticInjectorError[SuperTabsController]:
NullInjectorError: No provider for SuperTabsController!
at NullInjector.get (core.js:923)
at resolveToken (core.js:1211)
at tryResolveToken (core.js:1153)
at StaticInjector.get (core.js:1024)
at resolveToken (core.js:1211)
at tryResolveToken (core.js:1153)
at StaticInjector.get (core.js:1024)
at resolveNgModuleDep (core.js:10585)
at NgModuleRef
.get (core.js:11806)
at resolveDep (core.js:12302)
at NullInjector.get (core.js:923)
at resolveToken (core.js:1211)
at tryResolveToken (core.js:1153)
at StaticInjector.get (core.js:1024)
at resolveToken (core.js:1211)
at tryResolveToken (core.js:1153)
at StaticInjector.get (core.js:1024)
at resolveNgModuleDep (core.js:10585)
at NgModuleRef
.get (core.js:11806)
at resolveDep (core.js:12302)
at c (polyfills.js:3)
at Object.reject (polyfills.js:3)
at NavControllerBase._fireError (nav-controller-base.js:223)
at NavControllerBase._failed (nav-controller-base.js:216)
at nav-controller-base.js:263
at t.invoke (polyfills.js:3)
at Object.onInvoke (core.js:4629)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3

import { SuperTabsModule } from ‘ionic2-super-tabs’;

@NgModule({

imports: [

SuperTabsModule.forRoot()
],

})
export class AppModule {}