I'm inside a component, trying to add a newly created entity in an action:
var stakeholding = this.get('store').createRecord('stakeholding', {[...]});
var allCarings = this.get('allCarings');
allCarings.insertAt(0, stakeholding);
But I get this error message:
TypeError: internalModel.getRecord is not a function
allCarings
is initialized at page launch like this, inside the component:
this.store.find('stakeholding', {[...]}).then(function(data){
_this.set('allCarings', data);
});
How should I add my entity to the array properly?
Aucun commentaire:
Enregistrer un commentaire