If you save multiple pages on one page, you need to configure as shown below,
<ion-tab title="Rooms" icon-off="ion-ios7-box-outline" icon-on="ion-ios7-box" href="#/tab/rooms"> <ion-nav-view name="tab-rooms"></ion-nav-view> </ion-tab> <ion-tab title="Chat" icon-off="ion-ios7-chatboxes-outline" icon-on="ion-ios7-chatboxes" href="#/tab/chat"> <ion-nav-view name="tab-chat"></ion-nav-view> </ion-tab>
Thus, based on url, the corresponding view will receive rendering,
Otherwise, you can create a separate state for each view, as shown below,
.state('menuLogin', { url: '/menuLogin', abstract: true, templateUrl: 'templates/loginMenu.html'
})
.state('menuMain', { url: '/menuMain', cache:false, abstract: true, templateUrl: 'templates/mainMenu.html' }) .state('menuLogin.login', { url: '/login', views: { 'menuContent': { templateUrl: 'templates/login.html', controller: 'LoginCtrl' } } }) .state('menuMain.main', { url: '/main', views: { 'menuContent': { templateUrl: 'templates/main.html', controller: 'MainCtrl' } } })
So, the first state belongs to the login menu, and the second belongs to the main menu.
Loginmenu.html:
<ion-nav-bar class="bar-positive" align-title="center"> <ion-nav-back-button class="no-text"> </ion-nav-back-button> </ion-nav-bar> <ion-nav-view name="menuContent" align-title="center"></ion-nav-view>
and Mainmenu.html:
<ion-nav-bar class="bar-positive" align-title="center" style="text-align:center;"> <ion-nav-back-button class="no-text"> </ion-nav-back-button> <ion-nav-buttons side="right"> <button class="button button-icon button-clear ion-navicon" menu-toggle="right"> </button> </ion-nav-buttons> </ion-nav-bar> <ion-nav-view name="menuContent" align-title="center"></ion-nav-view>
So, you can configure the state as follows.
Hope this helps you.