Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49082

Ionic 5 Angular - Access Tab Page from Tabs Page

$
0
0

I’m trying to access a tab page from the tabs page with the following code. But this.tab1Page shows up as undefined in ngAfterViewInit. I’ve tried lots of other ways with no success. Any pointers on how to go about this?

import { Component, ViewChild } from '@angular/core';
import { Tab1Page } from '../tab1/tab1.page';

@Component({
  selector: 'app-tabs',
  templateUrl: 'tabs.page.html',
  styleUrls: ['tabs.page.scss']
})
export class TabsPage {

  constructor() {}

  @ViewChild(Tab1Page) tab1Page: Tab1Page;

  ngAfterViewInit() {
    console.log(this.tab1Page.tabId);
  }

}

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49082

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>