I have my custom Ember Component class and am trying to reset some attribute values
formData: Ember.Object.create({}),
resetformData: function() {
this.formData.attr1 = "";
this.formData.attr2 = ""; // This works
//All the below syntax are not working
this.formData.set('attr1', "");
this.formData.set('attr2', "");
this.set('formData', Ember.Object.create({
attr1: "",
attr2: ""
}));
this.set('formData', {
attr1: "",
attr2: ""
});
},
Now when I call this.resetformData(), I cannot get the attributes to reset using the "set" method syntax.
Aucun commentaire:
Enregistrer un commentaire