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

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

Comments

Projects
None yet
2 participants
@daffl
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

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Dec 4, 2012

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.

Contributor

justinbmeyer commented Dec 4, 2012

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 in 9bb1346 Dec 4, 2012

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