0

I have a simple Aurelia application that displays accounts. The default view is a list of accounts. There's also an account details view.

I'd to make the details view open in a modal/dialog over the top of the list view. However, I want the presence of the modal to show up as part of the URL.

I found it easy to use the aurelia-dialog plugin to display the details view, but can't figure out how to get the dialog's presence to show up in the URL.

Another option might be to throw out aurelia-dialog and use a child router to display the details view, then figure out how to make that show and hide as a modal.

And, of course, another possibility is that there's a better way that I just don't see yet.

Has anybody seen or created something like this?

Josh Schultz
  • 8,000
  • 9
  • 32
  • 39
  • BTW, the goals behind the goal here: 1) Let users see account details without losing their place in the list of accounts. 2) Deep linking to particular accounts. – Josh Schultz Oct 25 '16 at 17:21
  • I don't have a solution... and although I'm relatively new to Aurelia, I've been doing exactly what you're doing (using Bootstrap Modal rather than Aurelia-Dialog). I also have main Navs and a child Nav. Basically, as best as I can tell, unless you're running it through the main App router, it won't affect the URL by default. – LStarky Oct 26 '16 at 01:59

1 Answers1

0

One possibility that occurs to me would be to add the dialog's presence as a parameter to the current route and then call it. You could use the route like /account?dialog=true. Run some tests to ensure that the ?dialog=true still routes to the same page. Then, use that route to check whether that parameter is set and display or hide the dialog window. When you refresh the page, the dialog window should still be open/closed. This also means that whenever you open or close the dialog window, you need to send a new route to the router (basically same route but different parameter).

This isn't a detailed solution but might get you on the right path.

LStarky
  • 2,740
  • 1
  • 17
  • 47