Hi,
I am trying to select for example tab 3 of 5 by clicking a button on the page in tab zero.
is this possible?
I have tried injecting my TabsPage bean into the page in question but I can’t use that to call any operation (e.g. setRunninTab()) from it or access the ViewChild from it.
using this.nav.push(… ) does swap the page but doesn’t switch out the active tab!
Any help appreciated
This is my TabsPage
import { Component } from '@angular/core';
import { AboutPage } from '../about/about';
import { ContactPage } from '../contact/contact';
import {SettingsPage} from "../settings/settings";
import {HomePage} from "../home/home";
import {RunningPage} from "../running/running";
import { ViewChild } from '@angular/core';
import { Page, Tabs } from 'ionic-angular';
@Page({
templateUrl: 'build/pages/tabs/tabs.html'
})
export class TabsPage {
@ViewChild('myTabs') tabRef: Tabs;
public tab1Root: any;
public tab2Root: any;
public tab3Root: any;
public tabSettings: any;
public tabRunning: any;
constructor() {
// this tells the tabs component which Pages
// should be each tab's root Page
this.tab1Root = HomePage;
this.tab2Root = AboutPage;
this.tab3Root = ContactPage;
this.tabSettings = SettingsPage
this.tabRunning = RunningPage;
}
changed(event, item){
console.debug(''+this.tabRef)
}
setRunningTab(){
console.debug('setting running tab');
this.tabRef.select(this.tabRunning);
}
}