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

await loses access to outer each variable #1251

Closed
mrkishi opened this issue Mar 17, 2018 · 1 comment · Fixed by #1379
Closed

await loses access to outer each variable #1251

mrkishi opened this issue Mar 17, 2018 · 1 comment · Fixed by #1379
Labels

Comments

@mrkishi
Copy link
Member

mrkishi commented Mar 17, 2018

{{#each items as item}}
	{{#await item.data}}
		<p>{{item.title}}: Loading...</p>
	{{then result}}
		<p>{{item.title}}: {{result}}</p>
	{{/await}}
{{/each}}

<script>
	export default {
		data() {
			return {
				items: [{
					title: 'Some data',
					data: Promise.resolve('this will never show up'),
				},
				{
					title: 'Some other data',
					data: Promise.resolve('this will never show up'),
				}]
			}
		}
	}
</script>
> TypeError: Cannot read property 'title' of undefined

REPL

@Rich-Harris
Copy link
Member

Fixed in 2.3.0, thanks

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

Successfully merging a pull request may close this issue.

3 participants