correctly update yield fragment inside each, #230

pull/248/head
Arpad Borsos 8 years ago
parent f5ebc85e53
commit 20e1b05c45
No known key found for this signature in database
GPG Key ID: 908EDF65263368B4

@ -32,6 +32,7 @@ export default {
// Component has children, put them in a separate {{yield}} block // Component has children, put them in a separate {{yield}} block
if ( hasChildren ) { if ( hasChildren ) {
const yieldName = generator.getUniqueName( `render${name}YieldFragment` ); const yieldName = generator.getUniqueName( `render${name}YieldFragment` );
const { params } = generator.current;
generator.generateBlock( node, yieldName ); generator.generateBlock( node, yieldName );
@ -40,7 +41,7 @@ export default {
); );
generator.current.builders.update.addLine( generator.current.builders.update.addLine(
`${name}_yieldFragment.update( changed, root );` `${name}_yieldFragment.update( changed, ${params} );`
); );
componentInitProperties.push( `_yield: ${name}_yieldFragment`); componentInitProperties.push( `_yield: ${name}_yieldFragment`);

@ -1,3 +1,10 @@
export default { export default {
html: '<p>Hello Alice</p><p>Hello Bob</p><p>Hello Charles</p>' html: '<p>Hello Alice</p><p>Hello Bob</p><p>Hello Charles</p>',
test ( assert, component, target ) {
component.set({
people: [ 'Alice', 'Charles', 'Bob' ]
});
assert.htmlEqual( target.innerHTML, `<p>Hello Alice</p><p>Hello Charles</p><p>Hello Bob</p>` );
}
}; };

Loading…
Cancel
Save