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 in Loop can overwrite (case insensitive?) Component Name #88

Closed
stefnnn opened this issue Dec 1, 2016 · 2 comments
Closed
Labels

Comments

@stefnnn
Copy link

stefnnn commented Dec 1, 2016

If I use a variable in an loop, which clashes with a component name, I get an error when updating data ("vendor.set is undefined"), because the variable overwrites the component. I incorrectly assumed, that the component name is case-sensitive. I'm not sure, if this is the intended behaviour. If so, a warning would be rad 😄

	<div class="vendor_list">
		{{#each vendors as vendor, index}}

			<Vendor name="{{ vendor.name }} "/>
			
		{{/each}}
	</div>
@Rich-Harris Rich-Harris added the bug label Dec 2, 2016
@Rich-Harris
Copy link
Member

When I was writing the code a little voice in the back of my head kept saying 'you know you're going to have to deconflict all these variable names, right?'. To which I answered 'yeah, yeah – don't worry, I'll fix it before anyone notices'. Wrong!

Yep, we need to get more sophisticated about this. It should deconflict regardless of casing.

@Rich-Harris
Copy link
Member

Fixed in 1.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants