Angularjs Not Allowing Square Brackets In The Url Parameter - '['
I want to call and external api It is working fine if i have parameters like this $http.post('http://api.myprivatebox.com/users.json', { email : email, password : password}).then
Solution 1:
You could set the key by index notation of array as you want to set user['token']
dynamically
Code
var formData = { email : email, password : password};
formData[user['token']] = token; //assuming user & token object has already defined//user[token] : token
$http.post('http://api.myprivatebox.com/users.json', formData).then(function(results) {
console.log('mid');
});
Post a Comment for "Angularjs Not Allowing Square Brackets In The Url Parameter - '['"