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

Live binding on observe.lists nested in an observe doesn't work #204

Closed
moschel opened this Issue Dec 12, 2012 · 1 comment

Comments

Projects
None yet
1 participant
@moschel
Contributor

moschel commented Dec 12, 2012

test("list nested in observe live bindings", function(){
    can.view.mustache("list-test","<ul>{{#data.items}}<li>{{name}}</li>{{/data.items}}</ul>");
    var data = new can.Observe({
        items: [{name: "Brian"}, {name: "Fara"}]
    });
    var div = document.createElement('div');
    div.appendChild( can.view("list-test", {data: data}) );
    data.items.push(new can.Observe({name: "Scott"}))
    ok(/Brian/.test(div.innerHTML), "added first name")
    ok(/Fara/.test(div.innerHTML), "added 2nd name")
    ok(/Scott/.test(div.innerHTML), "added name after push")
});

This breaks, but passing data.items into the template directly works.

@moschel

This comment has been minimized.

Show comment
Hide comment
@moschel

moschel Dec 12, 2012

Contributor

fixed by c0d15ec

Contributor

moschel commented Dec 12, 2012

fixed by c0d15ec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment