I am using C#
/ EF
/ Angular
, in my backend I have the following method, which waits for 02 parameters:
public dynamic save(Entidades.CheckList json, Entidades.CheckList json1)
{
master = new ClassMaster();
Entidades.CheckList checkListModel = new Entidades.CheckList();
CheckListDTO checkListDto = new CheckListDTO();
return checkListDto.save(checkListModel, master.contexto);
}
no controller
of angular, I have this method:
$scope.Salvar = function (json, json1) {
$http.post("http://localhost:55959/CheckList/save", json, json1)
.success(function (data) {
if (data == "200") {
alert("Cadastro realizado com sucesso");
}
else
alert(data);
})
.error(function (error) {
alert("Erro");
});
};
In my view , I'm passing this way:
<div class="md-card-content" style="display: none;">
<div class="uk-width-medium-1-2">
<label>CNPJ</label>
<input id="cnpj1" class="md-input" type="text" required name="cli_cod" md-input="" ng-model="cliente.codigo">
</div>
<div class="uk-width-medium-1-2">
<label>CNPJ</label>
<input id="PBMS1" class="md-input" type="text" required name="cli_nov" md-input="" ng-model="cliente.novartis">
</div>
<div class="uk-width-medium-1-2">
<label>CNPJ</label>
<input id="User2" class="md-input" type="text" required name="user_cod" md-input="" ng-model="user.codigo">
</div>
<div class="uk-width-medium-1-2">
<label>CNPJ</label>
<input id="PBMS2" class="md-input" type="text" required name="user_nov" md-input="" ng-model="user.novartis">
</div>
</div>
<!--ng-click="salvarCliente(cliente)"-->
<div class="uk-clearfix uk-margin-large-top">
<button class="md-btn md-btn-primary uk-float-right" type="submit" ng-click="Salvar(user,cliente)">Salvar</button>
</div>
The problem is that it is only sent to the backend , one of the json
, the two is not sent, how do I make the controller
method of Angular
send both json
?