Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'getActiveChildNavs' of undefined #357

Closed
tamilm47 opened this issue Jan 21, 2019 · 1 comment
Closed

TypeError: Cannot read property 'getActiveChildNavs' of undefined #357

tamilm47 opened this issue Jan 21, 2019 · 1 comment

Comments

@tamilm47
Copy link

In my home.ts file i have both left and right side menu.I am trying to pass data to Tabs Page by using rootParams.Everything i did.When click from left side menu the TabsPage will shown properly.
So now i am in TabsPage(having 3 tabs).Then i select one item from right menu , TabsPage is not showing properly.Instead error throwing as below

TypeError: Cannot read property 'getActiveChildNavs' of undefined
    at findTopNavs (http://localhost:8100/build/vendor.js:22399:25)
    at http://localhost:8100/build/vendor.js:22405:27
    at Array.forEach (<anonymous>)
    at findTopNavs (http://localhost:8100/build/vendor.js:22404:19)
    at http://localhost:8100/build/vendor.js:22405:27
    at Array.forEach (<anonymous>)
    at findTopNavs (http://localhost:8100/build/vendor.js:22404:19)
    at http://localhost:8100/build/vendor.js:22405:27
    at Array.forEach (<anonymous>)
    at findTopNavs (http://localhost:8100/build/vendor.js:22404:19)
    at c (http://localhost:8100/build/polyfills.js:3:19752)
    at new t (http://localhost:8100/build/polyfills.js:3:21532)
    at __awaiter (http://localhost:8100/build/vendor.js:57894:12)
    at SuperTabsComponent.ngAfterViewInit (http://localhost:8100/build/vendor.js:58115:16)
    at callProviderLifecycles (http://localhost:8100/build/vendor.js:13122:18)
    at callElementProvidersLifecycles (http://localhost:8100/build/vendor.js:13089:13)
    at callLifecycleHooksChildrenFirst (http://localhost:8100/build/vendor.js:13072:29)
    at checkAndUpdateView (http://localhost:8100/build/vendor.js:14227:5)
    at callViewAction (http://localhost:8100/build/vendor.js:14569:21)
    at execComponentViewsAction (http://localhost:8100/build/vendor.js:14501:13)

I am using,

"ionic2-super-tabs": "^5.0.2",

home.ts

this.navCtrl.push(TabsPage,{pageTitle:page.title});
this.nav.setRoot("TabsPage");

tabs.html

  <super-tabs id="databaseTableTabs" selectedTabIndex="0" tabsPlacement="top" toolbarBackground="secondary" toolbarColor="light" indicatorColor="light" [config]="{ sideMenu: 'both' }" (tabSelect)="onTabSelect($event)">
    <super-tab [root]="page1" [rootParams]="pageMenuTiTle" title="Description" icon="home" id="descriptionTab"></super-tab>
    <super-tab [root]="page2" [rootParams]="pageMenuTiTle" title="Example" icon="pin" id="exampleTab"></super-tab>
    <super-tab [root]="page3" [rootParams]="pageMenuTiTle" title="Editor" icon="heart" id="editorTab"></super-tab>
  </super-tabs>

TabsPage.ts

  page1: any = 'Tab1';
  page2: any = 'Tab2';
  page3: any = 'Tab3';

  pageMenuTiTle : any;
  
  @ViewChild(SuperTabsComponent) superTabs: SuperTabsComponent;

  constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.pageMenuTiTle = navParams.data;
  }
  onTabSelect(ev:any){
    this.superTabs.slideTo(ev.Tab2);
  }

Tab1.html

<ion-content>
  <h4>{{pageMenuTiTle}}</h4>
</ion-content>

Tab1.ts

  pageMenuTiTle : any;

  constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.pageMenuTiTle=navParams.data;
  }

I know my issue description is too long.Someone please tell me.Thanks in advance

@ihadeed ihadeed closed this as completed Mar 28, 2019
@pkitatta
Copy link

Hi Did you find the solution to the problem? I am facing one too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants