2
votes

Is there a limitation on where named outlets can be placed? My templates don't render and when I specify the into property I get an error. Here is the relevant code: https://gist.github.com/knownasilya/5700187

This is the error:

Uncaught TypeError: Cannot call method 'connectOutlet' of undefined

Looks like parentView is null here: parentView.connectOutlet(options.outlet, view); (line 25461).

I'm setting the into property as the name of the template in which the outlet exists. Am I doing this wrong, should this be a route name (I don't have any routes for this parent view)?

Child View Route:

App.MapSearchRoute = Ember.Route.extend({
  renderTemplate: function() {
    this.render({
      into: "sidebar",
      outlet: "sidebar"
    });
  }
});

The outlet is here:

<ul class="navigation">
  <li>
    {{#linkTo map.search class="accent-blue"}}
      <i class="icon-search icon-white"></i>
    {{/linkTo}}
  </li>

  <li>
    {{#linkTo map.overlay class="accent-purple"}}
      <i class="icon-th-large icon-white"></i>
    {{/linkTo}}
  </li>

  <li>
    {{#linkTo map.contact class="accent-green"}}
      <i class="icon-envelope icon-white"></i>
    {{/linkTo}}
  </li>
</ul>

{{outlet sidebar}}

and that previous template is rendered in this template,which is rendered in the main outlet:

<div id="map"></div>
{{view App.SidebarView}}
1
Please could you share some code. Most useful will be the templates and the routes where you render templates. - Gevious
@Gevious I've updated my question with some code. Thanks! - knownasilya

1 Answers

2
votes

A great place to check for rendering help is in the ember guides.

You can have as many outlets as you like. Your code seems good, from what I can tell. I'm assuming you have a mapsearch template defined as well? That's the template that'll get rendered into the sidebar.

Try popping the sidebar outlet into the parent template. Since its not nested anywhere in your sidebar template, it won't make a visual difference. Make sure you change your 'into' flag when you render the template. Let me know how it works out for you.