Getting the model inside a controller emberjs
问题 I need to get the grand total price of all the objects returned from a JSON API. my idea is to create a controller and set a property on it. Then grab the model loop over each object and add to the predefined property that objects total price. Something like this: export default Ember.Controller.extend({ orderTotal: 0, getOrderTotal: function(){ var model = this.get('model'); model.forEach(function(c){ var order_total = this.get('orderTotal') * c.total_price; this.set('orderTotal', order