當從主頁的用戶移動到登錄背面,用戶不能在報頭顯示後退按鈕時用戶不在主頁
.config(function($stateProvider, $urlRouterProvider,$ionicConfigProvider){
$ionicConfigProvider.tabs.position("standard");
$ionicConfigProvider.tabs.style("standard");
$stateProvider
.state('tabs',{
url: '/tab',
abstract:true,
templateUrl:'templates/index_tabs.html',
})
.state('tabs.index',{
url:'/index',
views:{
'list-index':{
templateUrl: 'templates/index_files/index.html',
}
}
})
.state('tabs.login',{
url:'/login',
views:{
'list-login':{
templateUrl: 'templates/index_files/login.html',
}
}
})
$urlRouterProvider.otherwise('/tab/index')
})
的login.html
的頂部找到一個後退按鈕<ion-header-bar class="bar-positive" align-title="center">
<h1 class="title">Sign In</h1>
</ion-header-bar>
<ion-view>
<ion-content>
<div ng-app="starter" ng-controller="userlogin_controller">
<form id="login_form" name="login_form" method="post" action="">
<div class="list list-inset">
<div class="list modal">
<label class="item item-input item-stacked-label">
<span class="input-label">Email</span>
<input name="email" type="email" id="email" placeholder="[email protected]" ng-model="userlogin.email" required="required" autocomplete="off"/>
<div class="error" ng-show="login_form.email.$error.email">Email is not valid</div>
</label>
<label class="item item-input item-stacked-label"> <span class="input-label">Password</span>
<input name="password" type="password" id="password" placeholder="Enter password here" ng-model="userlogin.password" />
</label>
</br>
<p align="center">
<button ng-disabled="login_form.$invalid" class="button button-positive" ng-click="userlogin()"> Go viva</button>
</p>
</br>
<p align="center"><a href="#/tab/forgotpassword">Forgot your password?</a></p>
<p align="center"><button class="icon icon-left ion-social-facebook button button-positive button-small" ng-click="facebookSignIn()">Sign Up with Facebook</button></p>
</div>
</div>
</div>
</form>
</ion-content>
</ion-view>
的index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<!-- <script src="cordova.js"></script>-->
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>
<script src="cordova.js"></script>
<script src="js/ng-cordova.js"></script>
</head>
<body ng-app="starter">
<ion-nav-bar class="bar-positive">
<ion-nav-back-button class="button-clear">
Back
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view>
</ion-nav-view>
</body>
</html>
當用戶導航任何幫助就如何使後退按鈕出現遠離主頁?
嘗試使用在的login.html頁' <離子NAV-按鈕側離子view'後'此代碼替換您的login.html頁= 「主」> <按鈕類= 「按鈕按鈕圖標圖標離子字形左」> 離子NAV-按鈕> 離子NAV-酒吧>' –
@Anilkumar,可以你把你的代碼放到我的腳本中了嗎? – neiza