mercredi 25 février 2015

AngularJS: POST parameters in array notation

My angular.js app posts the following JSON to my backend API:



{"pickupAddress":
{"state":"d","country":"d","city":"d","zipCode":"d","street":"d"},
...}`


Instead of that my backend API required to receive not pickupAddress.state, but pickupAddress[state].


I tried to change the ng-model in my view (to myObject.pickupAddress['country']) but this produces some strange errors.


Aucun commentaire:

Enregistrer un commentaire