# Different Side Menus for different tabs

**URL:** <https://forum.ionicframework.com/t/different-side-menus-for-different-tabs/43172>\
**Category:** ionic-v1\
**Created:** [February 8, 2016, 5:45pm UTC](https://forum.ionicframework.com/t/different-side-menus-for-different-tabs/43172 "2016-02-08T17:45:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adreno\_abhi](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@adreno\_abhi](https://forum.ionicframework.com/u/adreno_abhi)\
**Post date:** [February 8, 2016, 5:45pm UTC](https://forum.ionicframework.com/t/different-side-menus-for-different-tabs/43172/1 "2016-02-08T17:45:33Z")

</div>

Hi all,

Can someone help me with an app i am trying to build where i need a tab based ui. But i need different side menus for different tabs. So that when i select a tab , the side menu changes accordingly with different menu items.

---

<div class="post-metadata">

**Author:** ![ihadeed](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ihadeed/32/95258_2.png) [@ihadeed](https://forum.ionicframework.com/u/ihadeed)\
**Post date:** [February 8, 2016, 8:23pm UTC](https://forum.ionicframework.com/t/different-side-menus-for-different-tabs/43172/2 "2016-02-08T20:23:33Z")

</div>

1. Add a $rootScope variable to hold the name of your tab. Example:  
`$rootScope.selectedTabName= 'home';`

2. In your tabs controller (create one if it doesn’t exist already) add the following function

3. In your tabs html code add the following attribute to each ion-tab element you have, make sure to change the string that refers to the tab name:  
`on-select="switchTab('home')"`

4. Add a controller for your menu that does the following:

What I recommend is that one of the menu items will be under ‘default’ and then change $scope.menuItems to the following to avoid errors (and to set a default menu items set):  
`$scope.menuItems = menuItems[$rootScope.selectedTabName] || menuItems['default'];`

1. Finally in your menu html do the following:

I hope that helps.

Notes:

- Not sure if you are supposed to put brackets inside of the ng-href
- You can also add an additional field to hold icon class name, and add that to your menu html as well.
