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

support binding to computed member expressions #605

Merged
merged 2 commits into from
Jun 1, 2017
Merged

Conversation

Rich-Harris
Copy link
Member

Fixes #602. This PR allows binding to computed member expressions:

<select bind:value='prop'>
	<option>foo</option>
	<option>bar</option>
	<option>baz</option>
</select>

<input bind:value='obj[prop]'>

<pre>
{{JSON.stringify(obj)}}
</pre>

Demo (won't work until this is released...)

Probably most useful when binding to properties that can't be written using dot notation where you don't control the structure of the data (user["last-name"] or whatever), but will work with arbitrarily complex member expressions.

@Rich-Harris Rich-Harris merged commit 66a1fd7 into master Jun 1, 2017
@Rich-Harris Rich-Harris deleted the gh-602 branch June 1, 2017 02:32
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

Successfully merging this pull request may close these issues.

1 participant