Hi there i made swipeable tabs with segments and slides out of blank project, Instead of Slide how can of Show desired page, for instance i have Three tabs in the first tab want to show List view and in second tab scroll able image gallery and in third tab images and Text with buttons. How to achieve this inside slide? so is there a way to show pages upon slide or instead of slide.
Hope you guys will help have a great day.
Here is the home.html
<ion-header>
<ion-navbar>
<ion-title color="dark">
Test App
</ion-title>
</ion-navbar>
<ion-segment color="dark" [(ngModel)]="page">
<ion-segment-button value="0" (click)="selectedTab(0)">
FirstTab
</ion-segment-button>
<ion-segment-button value="1" (click)="selectedTab(1)">
SecondTab
</ion-segment-button>
<ion-segment-button value="2" (click)="selectedTab(2)">
ThirdTab
</ion-segment>
</ion-header>
<ion-content padding>
<ion-slides #slider (ionSlideWillChange)="moveButton($event)">
<ion-slide>
<h1>First Slide</h1>
</ion-slide>
<ion-slide>
<h1>Second Slide</h1>
</ion-slide>
<ion-slide>
<h1>Third Slide</h1>
</ion-slide>
</ion-slides>
</ion-content>
And here is the home.ts
import { Component, ViewChild } from '@angular/core';
import { NavController, NavParams, Slides } from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
@ViewChild('slider') slider: Slides;
page="0"
constructor(public navCtrl: NavController, public naveParama: NavParams) {
}
selectedTab(ind){
this.slider.slideTo(ind);
}
moveButton($event) {
this.page = $event._snapIndex.toString();
}
}
And here is the app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}
Hope you guys will help Thank you in advance.