Link to home page?


#1

I have created a new app using the sidemenu template, and I would like to have my Title bring the user to the home page when clicked.

I have updated a page’s code to make the title clickable:

<ion-view>
  <ion-nav-title>
    <a href="#/app/home" ng-href="#/app/home">About</a>
  </ion-nav-title>
:

The problem is that when clicked, the menu icon mysteriously disappears to be replaced with a “< Back” button I do not want. How do I prevent this to happen?


#2

You could create a directive or controller to handle the click instead of doing href/ng-href and use $ionicHistory.nextViewOptions() to disableBack, etc.

http://ionicframework.com/docs/api/service/$ionicHistory/


#3

That worked, thank you. I’m surprised I have to create a controller or a directive for a simple “A” link. It doesn’t bode well for the future.