Problem
You have a collection of Post model objects displayed in a template and you want to be able to sort ascending or descending on one or more keys.
Solution
Create (or if you already have one: update) a PostsController that contains an action that do the actual sorting. This action called is when you click on an element in the template.
For this element you create an Ember component that implements a click event handler and delegates the event to the controller. The main reason for creating a component for the sort element is that you want to update the state of the element with an appropriate icon (or color or whatever) indicating which key is used for sorting and if sorting happened in an ascending or descending order.
Your new post is loading...