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

iteration section #object[property]:key disappears #1476

Closed
luxferre opened this issue Nov 13, 2014 · 0 comments
Closed

iteration section #object[property]:key disappears #1476

luxferre opened this issue Nov 13, 2014 · 0 comments

Comments

@luxferre
Copy link

v0.6.1
data:

{
    selectedKey: 'key1',
    heap: {
        key1: {
            a: 'optiona',
            b: 'optionb'
        },
        key2: {
            a: 'optiona',
            b: 'optionb'
        },
        key3: {
            c: 'optionc'
        }
    }
}

template:

<p>keys</p>
<ul class="select">
    {{#heap:key}}
    <li on-click="selectKey">{{key}} click me</li>
    {{/heap}}
</ul>
<p>available options for {{selectedKey}}</p>
<ul>
    {{#heap[selectedKey]:option}}
    <li>{{option}}</li>
    {{/heap [selectedKey]}}
</ul>

when I click key2 and then key1, section '#heap[selectedKey]:option' disappears
or when I call "ractive.set('selectedKey', 'key2');ractive.set('selectedKey', 'key1');" in console

jsfiddle: http://jsfiddle.net/luxferre/6ocsamw7/5/
I've tried "#each" syntax with no success http://jsfiddle.net/luxferre/6ocsamw7/6/

@luxferre luxferre changed the title iteration section #object:key disappears iteration section #object[property]:key disappears Nov 13, 2014
evs-chris added a commit to evs-chris/ractive that referenced this issue Nov 13, 2014
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

1 participant