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

Add can.Observe.List.prototype.replace #194

Closed
daffl opened this issue Dec 4, 2012 · 1 comment
Closed

Add can.Observe.List.prototype.replace #194

daffl opened this issue Dec 4, 2012 · 1 comment

Comments

@daffl
Copy link
Contributor

daffl commented Dec 4, 2012

It should be possible to replace on list with another so that list Controls can be initialized like this:

can.Control({
    init : function () {
        this.list = new Recipe.List();
        this.element.html(can.view('list.ejs', list));
        list.replace(Recipe.findAll());
    }
});

.replace can take an array, another can.Observe.List or a Deferred.

@justinbmeyer
Copy link
Contributor

Check the list fiddle I tweeted for an implementation.

Sent from my iPhone

On Dec 4, 2012, at 7:24 AM, David Luecke notifications@github.com wrote:

It should be possible to replace on list with another so that list Controls can be initialized like this:

can.Control({
init : function () {
this.list = new Recipe.List();
this.element.html(can.view('list.ejs', list));
list.replace(Recipe.findAll());
}
});
.replace can take an array, another can.Observe.List or a Deferred.


Reply to this email directly or view it on GitHub.

@daffl daffl closed this as completed in 9bb1346 Dec 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants