I have a user form which takes some inputs and does a Submit;
So every time on Submit, the following code gets called;
var newObj = {};
// Then I set newObj.prop1, newObj.prop2, etc
Ember.set(this.get('myServerParams'), 'someMainObj.propertyObj', newObj);
So I create a new object from scratch & then set it to 'myServerParams'
However there is a strange issue which I observe. In 'newObj', in certain cases, the previous values get added (e.g. Say I select 'prop2', then also newObj.prop1 = 'oldProp' gets added) & submitted to the server.
With the above code, how is that possible ?
Aucun commentaire:
Enregistrer un commentaire