Skip to content

Instantly share code, notes, and snippets.

@joachimhs
Created June 18, 2012 20:00
Show Gist options
  • Save joachimhs/2950393 to your computer and use it in GitHub Desktop.
Save joachimhs/2950393 to your computer and use it in GitHub Desktop.
ArrayController
Controller:
HS.BlogPostsListController = Em.ArrayController.create({
content: [],
sortAscending: true,
sortProperties: ['postDate'],
...
});
Populated with:
var blogPosts = HS.store.findAll(HS.BlogPost);
HS.BlogPostsListController.set('content', blogPosts);
View:
{{#each HS.BlogPostsListController.content}}
<li> <a {{bindAttr href="postFullUrl"}} {{bindAttr onclick="linkClickString"}} >{{postTitle}}</a></li>
{{/each}}
However, no matter what I set "sortProperties" or "sortAscending" to, the list is always the same as the JSON returned from the server...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment