Skip to content

Commit

Permalink
Merge pull request #10489 from ebryn/nested-yield-bug
Browse files Browse the repository at this point in the history
[BUGFIX release] Fix an issue with bindings inside of a yielded template when the yield helper is nested inside of another view
  • Loading branch information
rwjblue committed Feb 18, 2015
2 parents ad2ca44 + c3bde6c commit 87195cf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ember-htmlbars/lib/hooks/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function content(env, morph, view, path) {
}

if (isStream(result)) {
appendSimpleBoundView(view, morph, result);
appendSimpleBoundView(env.data.view, morph, result);
} else {
morph.setContent(result);
}
Expand Down
15 changes: 15 additions & 0 deletions packages/ember-htmlbars/tests/helpers/yield_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,21 @@ QUnit.test("yield should work for views even if _parentView is null", function()

});

QUnit.test("simple bindings inside of a yielded template should work properly when the yield is nested inside of another view", function() {
view = EmberView.create({
layout: compile('{{#if view.falsy}}{{else}}{{yield}}{{/if}}'),
template: compile("{{view.text}}"),
text: "ohai"
});

run(function() {
view.createElement();
});

equal(view.$().text(), "ohai");
});


QUnit.module("ember-htmlbars: Component {{yield}}", {
setup: function() {},
teardown: function() {
Expand Down

0 comments on commit 87195cf

Please sign in to comment.