Note that there are some explanatory texts on larger screens.

plurals
  1. POember.js v1.0.0-rc.1 -- Using a modal outlet, how do I route out of the modal on close?
    primarykey
    data
    text
    <p>I'm attempting to render all my modals through application routing, but I'm having trouble figuring out the proper way to return to a previous state after I dismiss the modal.</p> <p>Here's the basic setup:</p> <p>I have an outlet in my application template which I'm using to display modal dialogs.</p> <p>It looks something like:</p> <pre><code>{{ outlet modal }} </code></pre> <p>In my route mappings, I've defined hooks for the individual modal. For instance, my help dialog pops up with:</p> <pre><code>App.HelpRoute = Ember.Route.extend({ renderTemplate: function(controller, model) { this.render({ outlet: 'modal' }); } }); </code></pre> <p>Right now, I can display my modal through the uri:</p> <pre><code> foo.com/#/help </code></pre> <p>I have a hook to dismiss the modal using jQuery:</p> <pre><code>$('#modalHelpWindow').modal('hide'); </code></pre> <p>But this doesn't really help, because I'm just hiding the element. I need to update URI on dismissal. If I hit the same route again, the modal is already hidden, and doesn't display.</p> <p>What methods should I be using to dismiss the modal, and route the application back to its previous state? Should I just be using history.back()?</p> <p>Note, I am aware of this SO question, but the solution is not the preferred 'ember' way of doing things, as programmatically created views will not have their controllers associated properly <a href="https://stackoverflow.com/questions/14327949/whats-the-right-way-to-enter-and-exit-modal-states-with-ember-router-v2">What&#39;s the right way to enter and exit modal states with Ember router v2?</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload