Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable lost when using partials in Handlebars template #15637

Closed
CrushedPixel opened this issue Sep 6, 2017 · 1 comment
Closed

Variable lost when using partials in Handlebars template #15637

CrushedPixel opened this issue Sep 6, 2017 · 1 comment

Comments

@CrushedPixel
Copy link

I'm using ember-models-table to try and display models from Ember Data in a table - this does not work as expected though, as the table rows themselves have empty cells.

I've digged through the source code of ember-models-table and found the code responsible for the rendering of cell data. The models-table.hbs looks like this:

{{#each visibleContent as |record index|}}
    {{partial rowTemplate}}
{{/each}}

and the rowTemplate partial displays the record variable like this:

{{get record column.propertyName}}

The problem is that the record variable is set to undefined in the partial - I've added some debug code to show the issue:

{{#each visibleContent as |record index|}}
     {{log 'record is' record}}
     {{log 'record name is' (get record 'name')}}
     {{partial rowTemplate}}
{{/each}}
{{log 'record now is' record}}
{{get record column.propertyName}}

and this is my console output: console output

Why may the record variable become undefined in the partial?

Thanks for any help.

@Serabe
Copy link
Member

Serabe commented Sep 6, 2017

Duplicate of #15621

Thank you!

@Serabe Serabe closed this as completed Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants