Note that there are some explanatory texts on larger screens.

plurals
  1. POEmber.js How to add unrelated content(side bar/footer/modal) and pass id
    primarykey
    data
    text
    <p>I am working a fairly simple Emberjs application. However, I am having trouble figuring out one piece. </p> <p>This is a simple demo app for a client. I am making the different pages and having a modal dialog pop up when the user comes to each page. I am using the fixture adapter and have content for the modals for each page specified as a fixture.</p> <p>I have my pages that I navigate to and some have an id that I pass in. I have my routes defined for each of these. </p> <p>Now that I have all of that set up, I would like to add the modals to the page by passing the id in through the url. It doesn't seem like I should have to specify a modal route inside of each resource though. </p> <p>For example:</p> <p>This is the code I have to start with:</p> <pre><code> this.resource('test', {path: '/test'}, function() { this.resource('question', { path: '/:test_id'}); }); this.resource('home', {path: '/home'}); </code></pre> <p>When I want to add the modals it seems like I need to do something like this, but it doesn't seem right that I have to add the modal as a route to every resource I have. Then I would also have an enormous number of templates/controllers etc.</p> <pre><code> this.resource('test', {path: '/test'}, function() { this.resource('question', { path: '/:test_id'}, function() { this.route('modal', {path: '/modal/:modal_id'}); }); }); this.resource('home', {path: '/home'}, function() { this.route('modal', {path: '/modal/:modal_id'}); }); </code></pre> <p>This may be because I am a rookie with Emberjs, but I haven't seen anything to offer an alternative for unrelated dynamic content on a page.</p> <p>Any help is appreciated.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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