samedi 27 juin 2015

Is it correct update client side object with angular.copy response

I have an import functionality client side page with display 'Save button' or 'Saved lable' depends on entity`s id.

enter image description here

Here is my save function: response of it is created on server side, stored into database and selected after that object (after save i'd like to display stored value, which one should already have id (auto_increment PK)):

enter image description here

So, after i saved order and got response with stored value, i need to update passed as argument order (to set order's id, so that's saving button gone invisible and saved label showed).

I did it with angular.copy(entity, order), but is it correct and is there other practices with applying and displaying stored value from response.

Aucun commentaire:

Enregistrer un commentaire