diff --git a/packages/ember-htmlbars/lib/templates/legacy-each.hbs b/packages/ember-htmlbars/lib/templates/legacy-each.hbs index c109ab3d491..c6b7983fe04 100644 --- a/packages/ember-htmlbars/lib/templates/legacy-each.hbs +++ b/packages/ember-htmlbars/lib/templates/legacy-each.hbs @@ -1 +1 @@ -{{~#each view._arrangedContent as |item|}}{{#if attrs.itemViewClass}}{{#view attrs.itemViewClass controller=item tagName=view._itemTagName}}{{legacy-yield item}}{{/view}}{{else}}{{legacy-yield item controller=item}}{{/if}}{{else if attrs.emptyViewClass}}{{view attrs.emptyViewClass tagName=view._itemTagName}}{{/each~}} +{{~#each view._arrangedContent as |item|}}{{#if attrs.itemViewClass}}{{#view attrs.itemViewClass controller=item _defaultTagName=view._itemTagName}}{{legacy-yield item}}{{/view}}{{else}}{{legacy-yield item controller=item}}{{/if}}{{else if attrs.emptyViewClass}}{{view attrs.emptyViewClass _defaultTagName=view._itemTagName}}{{/each~}} diff --git a/packages/ember-htmlbars/tests/helpers/each_test.js b/packages/ember-htmlbars/tests/helpers/each_test.js index eebf4840529..d64c36c0730 100644 --- a/packages/ember-htmlbars/tests/helpers/each_test.js +++ b/packages/ember-htmlbars/tests/helpers/each_test.js @@ -589,7 +589,7 @@ QUnit.test("it supports {{itemViewClass=}} via container", function() { assertText(view, "Steve HoltAnnabelle"); }); -QUnit.test("it supports {{itemViewClass=}} with tagName (DEPRECATED)", function() { +QUnit.test("it supports {{itemViewClass=}} with each view tagName (DEPRECATED)", function() { runDestroy(view); view = EmberView.create({ template: templateFor('{{each view.people itemViewClass=MyView tagName="ul"}}'), @@ -603,6 +603,25 @@ QUnit.test("it supports {{itemViewClass=}} with tagName (DEPRECATED)", function( equal(view.$('ul li').text(), 'Steve HoltAnnabelle'); }); +QUnit.test("it supports {{itemViewClass=}} with tagName in itemViewClass (DEPRECATED)", function() { + runDestroy(view); + registry.register('view:li-view', EmberView.extend({ + tagName: 'li' + })); + + view = EmberView.create({ + template: templateFor('