jeudi 26 janvier 2017

Applying pushObject() to model

This Twiddle is a simple Ember application that tracks the attendance of employees.

It consists of two columns of employee names. On arrival or departure, each employee clicks their name to sign in or out.

The problem is that employees cannot currently sign out.

I'm seeing the error

TypeError: internalModel.getRecord is not a function

for this line

this.get(b).pushObject(item);

I think it's because in this case, b = Ember.computed.alias('model') which isn't an array and therefore pushObject can't be applied. Right?

I suppose I need to know how to map my model to an array or perhaps try a different approach.




Aucun commentaire:

Enregistrer un commentaire