Can I re-use a side menu as a modal chooser


#1

I have side-menu organized application following the “ionic start myApp sidemenu” example.

I have two main menu items in the top level menu “matches” and “opponents”. The “opponents” menu slides out to a list of “opponents”. From this view the user can Create new Opponents or delete existing opponents. Selecting a particular opponent allows the user to see and update details about the opponent. The “matches” menu slides out t a list of “matches”. From this view the user can Create new Matches or delete existing matches. Selecting a particular match allows the user to see and update details about the match.

Matches must have two and only two opponents. In the update view of a match I want to allow the user to select opponents from the list of opponents. In an ideal world I want to re-use the UI and business logic that I have already created for managing the list of opponents including creating new opponents. I originally thought this could work by simply routing the user back to the list of wrestlers. But here is the problem how would I have selection loop back to the update match view instead of giving details about the opponent.

In native Android development I could accomplish this with intents, what is the equivalent in ionic?


#2

Hmm, not sure from just reading about it. Would something like this work?


#3

That wasn’t quite exactly what I was thinking. I was hoping to re-use my existing ui-router states/views somehow not uses $ionicModal service. I know with out a code example it is kind of hard to describe.

However, your codepen using a directive to wrap the ionicModal was very helpful. Perhaps a directive might be the best way to get the re-use of the list of opponents view. It has given my a few thoughts to chew on.

Thank you for the response!