@GregWeb wrote:
I’m making a simple todo list and this one has stumped me completely. When I click on a task’s checkmark, I’d like for that element in the model to be moved to the bottom of the list. I found NO way to do this. THe change needs to be persisted to a firebase backend, or localStorage if I decide to swap out the firebase adapter with a localStorage adapter.
I tried something naive like:
{{#each model as |task index|}} <p {{action 'toggleTask' task task.isDone index}}>Some el</p> {{/each}} controller.js// toggleTask(task, prop, i){ task.set(i, 0); task.toggleProperty(prop); task.save(); },
This doesn’t throw an error or anything, nothing happens. I tried a bunch of other ember and native javascript methods but nothing works. Haven’t found anything about this online. btw aside from trying to change the index of the elemtn the other two methods ni
toggleTask()
work fine
Posts: 8
Participants: 3