I have the following code:
$http.post(constants.path+'address.php', {form}).then(function(data){
console.log(data);
console.log("success");
});
}
Only on Safari I get the following error:
'SyntaxError: Unexpected token '}'. Expected a ':' following the property name 'form'.
Every other browser don't complain about this code. Any ideas ?
EDIT 1: The whole function is:
function enviaVaga(form){
console.log(form);
return $http.post(constants.path+'json.php', {form}).then(function(data){
console.log(data);
console.log("sucesso");
});
}
This is a service function to send data to my backend
EDIT2: Just for future reference, removing the {} created the problem that my backend was expecting to receive a form
object on $formData
, to solve this I use {form: form}
, that works well on Safari.