Ionic sidemenu change

Good day all, i have problem.
i use $ ionic start myApp sidemenu.
Push button login on sidemenu, how after login change sidemenu? del login button?
Template menu:\www\templates\menu.html
I think i can change template or no? help me pls)

You could set the menu items in a div, then apply ng-show or ng-if. But you must set certain conditions in the controller.js. For example if user is logged in, ng-show="!loggedIn == true" for the login button and ng-show=“loggedIn == true” for the logout button. Hope it helps!

1 Like

Take a look at the TrendCity demo app (from the book ‘Developing an Ionic Edge’) on GitHub:


    <ion-item menu-close class="item-icon-left" ng-click="login()" ng-hide="isLoggedIn()">
        <i class="icon ion-log-in"></i>
    <ion-item menu-close class="item-icon-left" ng-click="logout()" ng-show="isLoggedIn()">
        <i class="icon ion-log-out"></i>