Note that there are some explanatory texts on larger screens.

plurals
  1. POMarionette (has no method render)
    primarykey
    data
    text
    <p>I am getting an error <code>has no method 'render'</code> and I'm not sure why. The only difference is whether the <code>currentUser</code> is being passed in. In both cases I'm overriding it locally in <code>getFooterView</code> so that doesn't seem to be the problem.</p> <p>Why would this make a difference and how does this have anything to do with the <code>render</code> method?</p> <p>This code works:</p> <pre><code>@Demo.module "FooterApp.Show", (Show, App, Backbone, Marionette, $, _) -&gt; Show.Controller = showFooter: -&gt; currentUser = App.request "get:current:user" footerView = @getFooterView(currentUser) App.footerRegion.show footerView getFooterView: (currentUser) -&gt; currentUser = App.request "get:current:user" new Show.Footer model: currentUser </code></pre> <p>but this doesn't:</p> <pre><code>@Demo.module "FooterApp.Show", (Show, App, Backbone, Marionette, $, _) -&gt; Show.Controller = showFooter: -&gt; currentUser = App.request "get:current:user" footerView = @getFooterView App.footerRegion.show footerView getFooterView: -&gt; currentUser = App.request "get:current:user" new Show.Footer model: currentUser </code></pre> <p>Here is the error I'm getting:</p> <pre><code>Uncaught TypeError: Object function () { var currentUser; currentUser = App.request("get:current:user"); return new Show.Footer({ model: currentUser }); } has no method 'render' </code></pre> <p>And here is the show footer:</p> <pre><code>@Demo.module "FooterApp.Show", (Show, App, Backbone, Marionette, $, _) -&gt; class Show.Footer extends Marionette.ItemView template: "footer/show/templates/show_footer" tagName: "span" modelEvents: "change" : "render" </code></pre>
    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.
    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