Jay
Jay

Reputation: 703

How to give href to navigation bars buttons like ion-item

I want to add href to navigation bar buttons like we do for the ion-item. For example:

<ion-list>

    <ion-item menu-close href="#/app/home">
    Dashboard
    </ion-item>        
    <ion-item menu-close href="#/app/aboutus">
    About Us
    </ion-item>

</ion-list>

I want exactly this to happen for navigation buttons. But I couldn't find a href thing for button. I tried both $state.go('app.home') and $window.location.href = '#/app/home'; for the button and both works. But it hides the menu button in the navigation bar with a back button. I do not want it to be happen like that. I want the menu button there. Like when we click the 'dashboard' in the menu.

Any help will be appreciated.

Upvotes: 0

Views: 598

Answers (2)

Avinash Rathod
Avinash Rathod

Reputation: 610

As per my knowledge you can not use "href" tag for <ion-item>. <ion-item> tag is only used under <ion-list>

It seems you are trying to make tabs. If it is correct you can create tab view project of ionic using following command.
"ionic start myApp tabs"

Upvotes: 0

Jay
Jay

Reputation: 703

I got the answer for this.

In the ion-side-menus tag, write enable-menu-with-back-views attribute value to 'true', which is 'false' by default.

Eg: enable-menu-with-back-views="true"

Upvotes: 0

Related Questions