When trying to access the model of a controller when creating a computed property on the controller, I get the following error:
model.uniqBy is not a function
app/controller/ticket.js
export default Ember.Controller.extend({
statuses: Ember.computed('model', function() {
var model = this.get('model');
return model
.uniqBy('status')
.map(function(i) { return i.status; })
.toArray();
}),
});
The model I'm giving to the controller is a collection returned from this.store.findAll('ticket');
, but trying to iterate through it seems to be causing the above error. Is the collection given to the model not supposed to be an Ember.Enumerable object? Should I be trying to access the collection via the DS.Store (in which case I don't understand the need to pass a model to the controller)?