Skip to content

Instantly share code, notes, and snippets.

@amiel
Last active December 30, 2015 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amiel/7793267 to your computer and use it in GitHub Desktop.
Save amiel/7793267 to your computer and use it in GitHub Desktop.
# LineItemsController
categories: (->
@get('model').mapBy('category').uniq().map (category) =>
Ember.Object.create
name: category
line_items: @get('model').filterBy 'category', category
).property('@each.category')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment