【发布时间】:2015-03-13 12:54:02
【问题描述】:
使用 ionic 框架,我试图创建一个包含导航按钮的抽象视图,但它似乎不起作用:
索引.html
<ion-nav-bar align-title="left" class="bar-stable"></ion-nav-bar>
<ion-nav-view></ion-nav-view>
抽象视图:
<script id="menu.html" type="text/ng-template">
<ion-view cache-view="false">
<ion-nav-buttons side="right">
<button class="button button-icon ion-more"></button>
</ion-nav-buttons>
<ion-nav-view></ion-nav-view>
</ion-view>
</script>
第 1 页:
<script id="page1.html" type="text/ng-template">
<ion-view cache-view="false" title="Page 1">
<ion-content>
<h1>This is page 1</h1>
<a ui-sref="page2">Go to page 2</a>
</ion-content>
</ion-view>
</script>
第 2 页:
<script id="page2.html" type="text/ng-template">
<ion-view cache-view="false" title="Page 2">
<ion-nav-buttons side="right">
<button class="button button-icon ion-more"></button>
</ion-nav-buttons>
<ion-content>
<h1>This is page 2</h1>
<a ui-sref="page1">Go to page 1</a>
</ion-content>
</ion-view>
</script>
全码笔:http://codepen.io/anon/pen/XJxoLb
第 1 页视图没有导航按钮,但第 2 页视图可以,因为它直接在自己的视图中包含 ion-nav-buttons。
如果我将 ionic 版本更改为 beta 13,它确实可以工作。
这是更高版本中的错误,还是我需要做一些不同的事情才能在最新版本(beta 14,rc 0)中工作?
【问题讨论】: