4

Using the ionic framework I'm trying to have an abstract view that contains a nav button, however it does not seem to work:

Index.html

<ion-nav-bar align-title="left" class="bar-stable"></ion-nav-bar>
<ion-nav-view></ion-nav-view>

Abstract 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>

Page 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>

Page 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>

Full code pen: http://codepen.io/anon/pen/XJxoLb

The page 1 view does not get the nav button, but the page 2 view does, because it includes the ion-nav-buttons directly in it's own view.

If I change the ionic version to beta 13, it does work.

Is this a bug in later versions, or do I need to do something different for this to work i latest versions (beta 14, rc 0)?

1 Answer 1

1

Apparently, this is by design: https://github.com/driftyco/ionic/issues/3332#issuecomment-81850467

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.