Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ng:repeat should optionally not reuse nodes #473

Closed
IgorMinar opened this issue Jul 14, 2011 · 1 comment
Closed

ng:repeat should optionally not reuse nodes #473

IgorMinar opened this issue Jul 14, 2011 · 1 comment
Milestone

Comments

@IgorMinar
Copy link
Contributor

ng:repeat does some very efficient DOM manipulation, but all of these tricks are not suitable for some use cases, e.g.:

  • apps that do extra dom manipulation for repeated nodes that ng:repeat doesn't know about
  • apps that would like to animate reordering of data (and nodes)

when ng:repeat notices that the model changed and that there are more or fewer elements in the repeated collection, then it just adds the required number of new nodes or throws away the required number of nodes and reuses the remaining ones by just simply updating the data bindings. this means that all the extra DOM stuff that it doesn't know about gets lost or associated with wrong node.

we should have a way to tell ng:repeat that this behavior is not desirable and that it should be less efficient but more friendly towards this extra dom manipulation.

here is one test case that is broken due to the current behavior of ng:repeat: http://jsfiddle.net/gronky/XsHqL/

@IgorMinar
Copy link
Contributor Author

After a long discussion we decided to mark this issue as wontfix. For more details please see the commit message for a related issue.

3ea2416

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant