I'm trying to send to a web a JSON witch contains several 'objects' (there are no real objects yet).
This is my array:
$scope.atributs = [];
When I click on the button this is executed:
$scope.addRow = function(){
var newRow = {
nomAtribut: "",
tipus: "",
mida: "",
prioritat: "",
obligatori: "",
observacions: ""
}
$scope.atributs.push(newRow);
}
Then I have a second one button, when I click it this is happening:
$scope.sendRow = function(){
var d = {
'nomAtribut': 'Saab',
'tipus': 'String',
'mida': '15',
'prioritat': '1',
'obligatori': 'No'
};
$http.post("http://10.0.203.73/WS/ws.php/tipusactius/alta", angular.toJson(d)).success(function(data){
$scope.status = data;
})
}
For testing I'm sending one single string JSON transforming it to real JSON object. It's my first angular project, I'm not sure if i did it ok? How I should do it?
Regards