Skip to content

[Glimmer] {{each}} with itemViewClass = broken tagName & {{else}}  #11164

Closed
@owain

Description

@owain

When using itemViewClass with {{each}} in Ember 1.13-beta.1, the item view's tagName is not used and is always rendered with a div.

<ul>
      {{#each model itemViewClass="listItem" as |item|}}
        <h4>{{item}}</h4>
      {{/each}}
</ul>
App.ListItemView = Em.View.extend({
  tagName: 'li'
});

The above code should:

<ul>
  <li><h4>item #1</h4><li>
</ul>

But actually renders:

<ul>
  <div><h4>item #1</h4><div>
</ul>

When an {{else}} is used with and {{each model itemViewClass ...}}, the template is not rendered when model is falsey. It works fine when there is no itemViewClass

<ul>
      {{#each model itemViewClass="listItem" as |item|}}
        <h4>{{item}}</h4>
      {{else}}
        <h4>No Data</h4>
      {{/each}}
</ul>

Both issues are illustrated in this JSBin: http://emberjs.jsbin.com/xumihahiwa/1/edit

There's also seems to be an issue thrown with the toggle action I added in there to set the model data on the controller to illustrate the {{else}} issue.

Here's it functioning fine with Ember 1.12: http://emberjs.jsbin.com/fepavokome/1/edit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions