Tôi muốn đặt chế độ xem theo tab bên trong ứng dụng menu bên, nhưng chỉ trong một số chế độ xem của ứng dụng. Trong một ứng dụng có cấu trúc nhà nước sau đây:tab ion và lịch sử menu bên
|--- Login (login: menuContent)
|--- Orders list (app.orders: menuContent)
|--- Description (app.orderTabs.description: orderTabs-description)
|--- Products (app.orderTabs.products: orderTabs-products)
|--- New product (app.orderTabs.products.newProduct: orderTabs-products)
|--- Alerts list (app.alerts: menuContent)
|--- Description (app.alertTabs: alertTabs-description)
|--- Settings (app.alertTabs: alertTabs-settings)
là mỗi mục | --- ViewTitle (trạng thái: ion-nav-view name)
menu.html:
<ion-side-menus enable-menu-with-back-views="false">
<ion-side-menu-content>
<ion-nav-bar class="bar-stable">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" menu-toggle="left">
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="menuContent"></ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-header-bar class="bar-stable">
<h1 class="title">Menu</h1>
</ion-header-bar>
<ion-content>
<ion-list>
<ion-item nav-clear menu-close href="#/app/orders">
Orders list
</ion-item>
<ion-item nav-clear menu-close href="#/app/alerts">
Alerts list
</ion-item>
<ion-item nav-clear menu-close ng-click="logout()">
Logout
</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
</ion-side-menus>
orderTabs.html:
<ion-tabs class="tabs-icon-top tab-bar">
<ion-tab title="Order" icon="icon ion-clipboard" href="#/app/orderTabs/{{ data.order.id }}/description">
<ion-nav-view name="orderTabs-description"></ion-nav-view>
</ion-tab>
<!-- products Tab -->
<ion-tab title="Products" icon="icon ion-checkmark-circled" href="#/app/orderTabs/{{ data.order.id }}/products" badge="data.badgeProducts" badge-style="badge-assertive">
<ion-nav-view name="orderTabs-products"></ion-nav-view>
</ion-tab>
</ion-tabs>
Tôi muốn có thể chuyển từ Mô tả hoặc Sản phẩm b ack vào danh sách các đơn đặt hàng, bất kỳ ai biết nếu nó có thể?
Hiện tại tôi đã đạt được để hiển thị nút quay lại trong thứ tự, nhưng khi tạo chế độ xem thẻ ion, lịch sử sẽ bị xóa.
Từ danh sách các lệnh điều khiển:
$scope.goToOrder = function gotToOrder(orderId) {
$ionicViewSwitcher.nextDirection('forward');
$ionicHistory.nextViewOptions({
historyRoot: false
});
$state.go('app.orderTabs.order', {
orderId: orderId
});
};