@rasool wrote:
My problem is that when i navigate from home state to user.tab1 state, the back button does not appear in navbar, how can i solve this problem, i'm new to ionic
I have this states in my project:
var app = angular.module('myApp', ['ionic']); app .config(function ($stateProvider, $urlRouterProvider) { $stateProvider .state('home', { url: '/home', templateUrl: './templates/test/home.html' }) .state('user', { url: '/user', templateUrl: './templates/test/user.html' }) .state('user.tab1', { url: '/tab1', views: { 'tab1': { templateUrl: './templates/test/tab1.html' } } }) .state('user.subtab1', { url: '/subtab1', views: { 'tab1': { templateUrl: './templates/test/sub-tab1.html' } } }) .state('user.tab2', { url: '/tab2', views: { 'tab2': { templateUrl: './templates/test/tab2.html' } } }); $urlRouterProvider.otherwise("/home"); });
and these are the templates:
index.html
<body ng-app="myApp"> <ion-nav-bar class="bar bar-calm"> <ion-nav-back-button> </ion-nav-back-button> </ion-nav-bar> <ion-nav-view> </ion-nav-view> </body>
home.html
<ion-view view-title="Home"> <ion-content> <a ui-sref="user.tab1">user.tab1</a> </ion-content> </ion-view>
user.html
<ion-view view-title="User"> <ion-tabs> <ion-tab title="tab1" href="#/user/tab1"> <ion-nav-view name="tab1"></ion-nav-view> </ion-tab> <ion-tab title="tab2" href="#/user/tab2"> <ion-nav-view name="tab2"></ion-nav-view> </ion-tab> </ion-tabs> </ion-view>
tab1.html
<ion-view view-title="tab1"> <ion-content> tab1 <br /> <a ui-sref="user.subtab1">user.subtab1</a> </ion-content> </ion-view>
tab2.html
<ion-view view-title="tab2"> <ion-content> tab2 </ion-content> </ion-view>
sub-tab1.html
<ion-view view-title="sub-tab1"> <ion-content> sub-tab1 </ion-content> </ion-view>
Posts: 1
Participants: 1