Navbar back button inconsistent


#1

I really dont undestand how back button works in ionic
here is one example

In above example navbar back button works as expected but same example when modified a bit back button disapperars can any one help me with this , here is modified example

What i changed

<a class="item" menu-close href="#/tab/facts2">More Facts</a>

to

<a class="item" menu-close href="#/facts2">More Facts</a>

in javascript

.state('tabs.facts2', {
  url: "/facts2",
  views: {
    'home-tab': {
      templateUrl: "facts2.html"
    }
  }
})

to

 .state('facts2', {
  url: "/facts2",

      templateUrl: "facts2.html"
  
})

Before making these changes when i navigate from Home >> Facts >> More Facts there appears a back button but in modified there is no back button for More Facts .


#2

That is kind of the same as my problem, which I explained here. From what I understand, the back button only appears when a view gets replaced. For example, the state ‘tabs.facts1’ uses the ‘home-tab’ view, and when it gets replaced by ‘tabs.facts2’ using the same view, the back button appears. From what you’ve changed the view that gets replaced is not ‘home-tab’ anymore but the default one (the one without a name).

That’s from what I’ve understood so far, so don’t take my word on it. I can only say that from what I’ve experienced that is not always the case. Here is hoping someone can clarify on this matter.