Hi,
I am wondering if anyone know how this would work. I am trying to put the sidemenu into a separate file for navigation instead of putting everything in app.component.ts.
I was able to get side menu working if I put the side menu into app.html file.
<ion-split-pane [when]="shouldShow()">
<ion-menu [content]="contentview" id="menu1">
<ion-header>
<ion-toolbar>
<ion-title>{{userObject('email')}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
<ion-list>
<button ion-item (click)='openPage()' menuClose>Dashboard
<ion-icon name="analytics" item-start></ion-icon>
</button>
<button ion-item (click)='signOut()' menuClose>Sign Out
<ion-icon name="md-exit" item-start></ion-icon>
</button>
</ion-list>
</ion-content>
</ion-menu>
<ion-nav [root]="rootPage" #contentview swipeBackEnabled="false" main></ion-nav>
</ion-split-pane>
Then in app.component.ts
I get the content reference
@ViewChild(‘contentview’) nav: Nav;
Then push the page
openPage(){
this.nav.push(‘BlankPage’);
}
However, if it put the entire thing into a separate file sidemenu.html
under app.html
<ion-split-pane [when]="shouldShow()">
<ion-menu [content]="contentview" id="menu1">
<ion-nav [root]="menuPage" #sidemenu swipeBackEnabled="false"></ion-nav>
</ion-menu>
<ion-nav [root]="rootPage" #contentview swipeBackEnabled="false" main></ion-nav>
</ion-split-pane>
How do I reference the #contentview from my sidemenu.ts?
I tried using in sidemenu.ts
@ViewChild(‘contentview’) nav: Nav;
but it return undefined.
I think getComponent used to work from my forum search, but it seems it was depreciated. Now I have no idea how to reference contentView so I can push views to the main page
Been hacking at this for couple days now, maybe I missed something.
Any ideas would be appreciated.
Thanks!