Side menu item not work after setRoot


#1

Hello,

I have an app that have a main page with some sidebar menu items:

<ion-menu [content]="mycontent" persistent="true">
    <ion-content>
        <ion-list>

            <button ion-item menuClose (click)="openPage(homePage)">
                <ion-icon name="ios-home-outline"></ion-icon>Hasiera
            </button>

            <button ion-item menuClose (click)="openPage(notificationsPage)">
                <ion-icon name="ios-notifications-outline"></ion-icon>Alertak
            </button>

            <button ion-item menuClose (click)="openPage(eventsPage)">
                <ion-icon name="ios-calendar-outline"></ion-icon>Agenda
            </button>

            <button ion-item menuClose (click)="openPage(reportsPage)">
                <ion-icon name="ios-albums-outline"></ion-icon>Abisua eman
            </button>

            <button ion-item menuClose (click)="openPage(noticesPage)">
                <ion-icon name="ios-paper-outline"></ion-icon>Udal albisteak
            </button>

            <button ion-item menuClose (click)="openPage(zaldibiaPage)">
                <ion-icon name="ios-link-outline"></ion-icon>Zaldibia.org
            </button>

            <button ion-item menuClose (click)="openPage(informationPage)">
                <ion-icon name="ios-cube-outline"></ion-icon>Telefono eta ordutegiak
            </button>

            <button ion-item menuClose (click)="openPage(reservesPage)">
                <ion-icon name="ios-call-outline"></ion-icon>Erreserba eskaerak
            </button>

        </ion-list>
    </ion-content>
</ion-menu>

<ion-nav #mycontent [root]="rootPage"></ion-nav>

Also, I have HomePage componente that is the rootPage of the app (and I set it in main.ts)

this.rootPage = HomePage;

In the home.html, I have some icons to navigate thorught the app sections:

<ion-header>
    <ion-navbar class="bar-calm">

        <ion-icon name="menu" menuToggle left></ion-icon>

        <ion-title>
            Hasiera
            <span class="logo"><img src="assets/imgs/logo.png"></span>
        </ion-title>

    </ion-navbar>
</ion-header>

<ion-content class="full-background">

    <ion-grid>

        <ion-row>

            <ion-col col-4>
                <button (click)="openPage(notificationsPage)">
                    <img src="assets/imgs/icon-alertak.png">
                    <span class="section">Alertak</span>
                </button>
            </ion-col>

            <ion-col col-4>
                <button (click)="openPage(eventsPage)">
                    <img src="assets/imgs/icon-agenda.png">
                    <span class="section">Agenda</span>
                </button>
            </ion-col>

            <ion-col col-4>
                <button (click)="openPage(reportsPage)">
                    <img src="assets/imgs/icon-abisua.png">
                    <span class="section">Abisua eman</span>
                </button>
            </ion-col>

        </ion-row>

        <ion-row>

            <ion-col col-4 offset-2>
                <button (click)="openPage(noticesPage)">
                    <img src="assets/imgs/icon-udala.png">
                    <span class="section">Udal albisteak</span>
                </button>
            </ion-col>

            <ion-col col-4>
                <button (click)="openPage(zaldibiaPage)">
                    <img src="assets/imgs/icon-zaldibia.png">
                    <span class="section">Zaldibia.org</span>
                </button>
            </ion-col>

        </ion-row>


        <ion-row>

            <ion-col col-4>
                <button (click)="openPage(informationPage)">
                    <img src="assets/imgs/icon-telefonoak.png">
                    <span class="section">Telefono eta ordutegiak</span>
                </button>
            </ion-col>

            <ion-col col-4 offset-4>
                <button (click)="openPage(reservesPage)">
                    <img src="assets/imgs/icon-erreserbak.png">
                    <span class="section">Erreserba eskaera</span>
                </button>
            </ion-col>

        </ion-row>

    </ion-grid>

</ion-content>

When I press in some button of the home.html, I go to the select page using this in home.ts

this.navCtrl.setRoot(page);

It redirects well. But in this moment, If I open the sidebar menu and I press to Home to go to the homepage, it not do anything, not redirects.

What I’m doing wrong?