Note that there are some explanatory texts on larger screens.

plurals
  1. POemberjs, wrong controller in each
    primarykey
    data
    text
    <p>If I have a template like so:</p> <pre><code>&lt;script type="text/x-handlebars" data-template-name="listbeer"&gt; {{#each controller}} &lt;li&gt;{{aname}}&lt;/li&gt; {{/each}} &lt;/script&gt; </code></pre> <p>then nothing will get displayed. On the other hand if I do:</p> <pre><code>&lt;script type="text/x-handlebars" data-template-name="listbeer"&gt; {{#each DHApp.beerlistController}} &lt;li&gt;{{aname}}&lt;/li&gt; {{/each}} &lt;/script&gt; </code></pre> <p>it works and I get the list from the controller's content displayed. Why is this? What controller am I seeing in the former case. Note that I have bound them in the view or so I thought with:</p> <pre><code>DHApp.ListbeerView = Ember.View.extend({ templateName: 'listbeer', }); DHApp.listbeerView = DHApp.ListbeerView.create({ controller: DHApp.listbeerController, contentBinding: 'controller.content' }); </code></pre> <p>so I'd expect to see the same. Note that the controller is an array one and as i say above its fine if I specify the controller in the each loop</p> <p>UPDATE: If I do </p> <pre><code>{{controller}} {{DHApp.listbeerController}} </code></pre> <p>then I get</p> <pre><code>&lt;DHApp.ListbeerController:ember192&gt; &lt;DHApp.ListbeerController:ember149&gt; </code></pre> <p>It looks like I am receiving the default controller not the one I instantiated. </p> <p>So is there a way to set the controller for the view to my instantiated one. OR a way to get the auto instantiated controller outside the route. I want access to the controller so I can update the controller model inside ajax responses, timers and things like that</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.
 

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