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