can.Model.List() updates its length after destoy() of one of its models only if it has bindings #495

Closed
azazel75 opened this Issue Oct 11, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@azazel75

As you can see in this example: http://jsfiddle.net/mQdjS/4/ a model.List instance reacts on element.destroy() (by removing it) only if it has at least one binding, otherwise it's length isn't updated.

@ghost ghost assigned imjoshdean Oct 25, 2013

@imjoshdean

This comment has been minimized.

Show comment
Hide comment
@imjoshdean

imjoshdean Oct 28, 2013

Contributor

I scratched my noodle on this one for a while. I see your point; however, I'm struggling to find the use case where something like this would happen. If you are doing a live bound template with both of these lists and you destroy one of the models in the list, then both of the lists will react as expected. This is because we bind on each list when rendering the template.

Can you provide a potential real-world example where you might be running into this situation? One where you would only be listening on changes to one list, but would be expecting results from the other one without binding on it? In the mean time, I'm going to have to call this one "won't fix" because it is working as expected.

Contributor

imjoshdean commented Oct 28, 2013

I scratched my noodle on this one for a while. I see your point; however, I'm struggling to find the use case where something like this would happen. If you are doing a live bound template with both of these lists and you destroy one of the models in the list, then both of the lists will react as expected. This is because we bind on each list when rendering the template.

Can you provide a potential real-world example where you might be running into this situation? One where you would only be listening on changes to one list, but would be expecting results from the other one without binding on it? In the mean time, I'm going to have to call this one "won't fix" because it is working as expected.

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