Creation of right side context side menu based on the left side menu content


I am developing one application which has a side menu having 3 items (say item 1, item 2 and item 3). When i click on item 1, the content changes according to item 1. Based on this content, i want to have a right side context side menu. item 2 and item 3 contents will also have different context menu. Can you please suggest a solution.


There are 2 ways to go about this :

1 : Likely the easiest

Have the contents of the right side menu be loaded from a service based on the current state.
So, you click Left 1 and navigate to some state. The controller for that state would load an array from the service. This array would hold the items for the right side menu.

2 : Use multiple views.

Because Ionic includes the Angular UI ui-router, your single state could have multiple views. In your app config, you could configure each state to have 2 views (center, right) and templates for each of them.

Here is a working example of that :

In this sample, when you choose different States in the left side menu, the right side menu is loaded with a different template.


Dear Calendee,
Thank you very much for the swift reply. I was able to solve the problem based on the second option. I really love the IONIC framework. It is a fantastic hybrid mobile framework. It would definitely become one of the best mobile development frameworks. Thanks for this nice tool.