mercredi 28 octobre 2015

Ember.$.param removes spaces from params and adds '+' sign

I am stuck with a problem. For instance if i have a json Object parameter like param = {abc: 'my example parameter'} and have an api like var api = 'api/xyz?'

now I want to append the parameters to my api, so I am using the following line of code

var url = api + Ember.$.param(param || {});

but the problem with this method is that when I use Ember.$.param(param || {}) and if the param contains spaces it results in as url = 'api/xyz?abc=my+example+parameter' instead of var url = 'api/xyz?abc=my example parameter'

I know I can always right a custom function for this but I want to do it using the Ember's inbuilt functionalities, so is there any such Emberish way in which I can get the required api call without '+' in the parameter for spaces.




Aucun commentaire:

Enregistrer un commentaire