私は親状態の順序と子状態のテーブルと記事を持っています。 'table'イオンビューのクリックイベントでは、それが私を 'articles'ビューにリダイレクトします。私がハードウェアの '記事'ビューで戻るボタンを押すと、URLは変わりますが、状態は同じです(order.article)。ここ は私のコードは裏面のイオンネストされた状態は状態を変更しません。
app.js
.state('order', {
url: '/order',
abstract: true,
templateUrl: 'templates/order/index.html'
})
.state('order.tables', {
url: '/tables',
views: {
'order-tables': {
templateUrl: 'templates/order/tables.html',
controller: 'OrderCtrl'
}
}
})
.state('order.article', {
url: '/article',
views: {
'order-article': {
templateUrl: 'templates/order/article.html',
controller: 'ArticleCtrl'
}
}
})
順/ index.htmlを
<ion-nav-view name="order-tables"></ion-nav-view>
<ion-nav-view name="order-article"></ion-nav-view>
<ion-nav-view name="order-unpaid"></ion-nav-view>
<ion-nav-view name="order-undone"></ion-nav-view>
順/ tables.html
<ion-view>
<ion-content>
<div class="bar bar-header bar-light" style="position: relative;">
<h1 class="title">Nova porudzbina</h1>
</div>
<ion-list>
<a ng-click="chooseItem(table.stoID)">
<ion-item collection-repeat="table in tables">
{{table.brojStola}}
</ion-item>
</a>
</ion-list>
</ion-content>
</ion-view>
です
また、イオンビューをタブに置くと、戻るボタンで状態が変わりました。
<ion-tabs>
<ion-tab title="Tables" href="#/order/tables">
<ion-nav-view name="order-tables"></ion-nav-view>
</ion-tab>
<ion-tab title="Articles" href="#/order/articles">
<ion-nav-view name="order-articles"></ion-nav-view>
</ion-tab>
</ion-tabs>
私はタブは必要ありませんが、なぜそれが正しく動作し、otnerで動作しないのか理解できません。
抽象状態のページを表示できません。という事は承知しています。 'order.table'と' order.articles'は私が訪問している状態です。 'order.tables'から' order.ables'と 'order.articles'から' order.tables'に行きます(戻るボタンで)私はまったく同じビュー( 'articles')を持っていますが、url chandes '/#/ order/tables'へ – neeev