I currently have the following models setup using Ember Data and the Local storage adaptor.
App.Game = DS.Model.extend
stage: DS.attr('number')
level: DS.attr('number')
actions: DS.hasMany('App.Action')
App.Action = DS.Model.extend
type: DS.attr('string')
time: DS.attr('number')
game: DS.belongsTo('App.Game')
I can access each action from within the template using
{{#each actions}}
{{type}}
{{/each}}
But I would like to access this same data from within the controller.
Is there are any to do this?
The following returns the actions length but I'd like to forEach over each action.
actionsLength: (->
@get('actions').get('length')
).property('actions.@each')
The route for this controller like the following.
App.GameRoute = Ember.Route.extend
model: (params) ->
App.Game.find(params.game_id)
Any help would be appreciated.