Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can set this actions in your application route</p> <pre><code>App.ApplicationRoute = App.Route.extend({ actions: { showModal: function() { this.render('modal', { outlet: 'modal', into: 'application' }); }, hideModal: function() { this.disconnectOutlet({ outlet: 'modal', parentView: 'application' }); } } }); </code></pre> <p>Then you can use query params in combination with setupController on the other Routes</p> <pre><code>this.resource('test', {path: '/test'}, function() { this.resource('question', { path: '/:test_id',queryParams: ['modalId']}); }); </code></pre> <p>and question route should be somthing like this</p> <pre><code>App.QuestionRoute = App.Route.extend({ setupController:function(controller,model,queryParams){ controller.set('model',model); if(queryParams.modalId){ var modalModel; //Set your modal model, here you have access to the store, etc this.controllerFor('modal').set('model', modalModel); this.send('showModal') } else{ this.controllerFor('modal').set('model', null); this.send('hideModal'); } } }); </code></pre> <p>Note: queryparams is an optional feature you shoul activate <a href="http://emberjs.com/guides/configuring-ember/feature-flags/" rel="nofollow">http://emberjs.com/guides/configuring-ember/feature-flags/</a></p> <p>You ca use the link-to helper, and transitionTo...</p> <p>link-to example, for open the modal with an id 1</p> <pre><code>{{#linkTo modelId=1}}modal 1{{/linkTo}} </code></pre> <p>For closing</p> <pre><code>{{#linkTo modelId=false}}Close modal{{/linkTo}} </code></pre> <p>More info on query params <a href="https://github.com/emberjs/ember.js/pull/3182" rel="nofollow">https://github.com/emberjs/ember.js/pull/3182</a></p>
 

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