Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4830

How to re-render the sorted array elements

$
0
0

I am trying to build a todo app. I want the todos to be in the order of their priority. Also, there are buttons with which we can increment/decrement the priority of a todo item.

import Component from ‘@ember/component’; import { computed } from ‘@ember/object’;

export default Component.extend({ tagName: “”, todos: computed(‘todos.@each.priority’, function(){ return this.todos.sortBy(‘priority’); }) });

This is how I tried to sort the todos. But this is not working.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4830

Trending Articles