Hello all,
I’m new to Ember and really enjoying learning a new framework.
I’ve run into an issue using {{#each}} to render a computed property. The entire list is re-rendered any time the computed property has an item added or removed.
Here is a simple todo list example: JS Bin - Collaborative JavaScript Debugging
Adding new todos you can see ‘didInsertElement’ called for every component in the list. If I loop over the controller ‘model’ instead, only the newly added element is rendered.
I’m not sure if this is a bug or intended feature but it’s causing issues with components that do a lot of initialization when they are inserted. Is there a way to avoid re-drawing every element when the computed property changes?
Here is one solution that uses an observer to update an array instead of using computed properties:
Is this an appropriate pattern? Seems like I’m re-writing the computed property…
Thanks!