0
我刚刚开始与Ionic,并遇到了一个令人困惑的问题;我有一对夫妇的设置页面(属性,测试和XYZZY)设置为路由器如下:动画,并保留标签页的历史
$stateProvider
.state('properties', {
url: '/properties',
templateUrl: 'templates/properties.html',
controller: 'PropertiesController'
})
.state('test', {
url: '/test',
abstract: true,
templateUrl: 'templates/test.html',
controller: 'TestController'
})
.state('test.one', {
url: '/one',
views: {
'one-tab': {
templateUrl: 'templates/test-one.html',
controller: 'TestController'
}
}
})
.state('test.two', {
url: '/two',
views: {
'two-tab': {
templateUrl: 'templates/test-two.html',
controller: 'TestController'
}
}
})
.state('xyzzy', {
url: '/xyzzy',
templateUrl: 'templates/xyzzy.html',
controller: 'XyzzyController'
});
本质上有两个普通而简单的页面(属性和XYZZY)和一个页面标签(测试)。每个页面的模板非常简单,看起来像这样 - Properties,Xyzzy和Test
够了解释,这里的问题:你可以看到,在XYZZY页面检测,我已经从属性导航到它页面,并给我一个很好的后退按钮。它不会显示,如果我去测试页面虽然(与选项卡)。该代码是这样的:
<ion-nav-bar class="bar-positive">
<ion-nav-back-button></ion-nav-back-button>
</ion-nav-bar>
此外,当我性能与XYZZY,就在一个可爱的小动画,看起来干净左/页幻灯片之间切换。但是,当我进入测试页面时,根本没有转换,当我离开时,也没有转换。
我花了几个小时环顾Google,但无法找到任何与标签页面转换/切换相关的内容。有任何想法吗?
更新:这里的景色正在兴建关闭(index.html中)的代码:
<body ng-app="app">
<ion-nav-bar class="bar-positive">
<ion-nav-back-button></ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view animation="slide-left-right"></ion-nav-view>
</body>
我试过了,它看起来像添加'name =“main”'导致没有内容加载,并且添加'animated =“slide-left-right”'不会改变功能ity - 我已将index.html添加到第一篇文章,如果有帮助 – Joe