I'm a novice in ember and I'm building a test app with ember.js. It's a calendar. I need to group events by day of week. In my controller I have something like this:
Calendar.WeekController = Ember.ArrayController.extend
sunday: ( ->
@get('content').filterProperty('dayOfWeek', 0)
).property('content.@each.dayOfWeek')
monday: ( ->
@get('content').filterProperty('dayOfWeek', 1)
).property('content.@each.dayOfWeek')
# for all days of week
In my template:
ul
each sunday
li = description
I think that looks wrong, but I have no idea how to improve this. Is there a better way to do this?