I have a grid with the data and also has an edit button.
Problem: When I click on change and start to modify the data, there on the grid the data is being changed too, even without saving.
My function that loads the data is this:
/* Função que carrega na grid, TODOS os pacientes cadastrados */
$scope.loadPacientes = function(){
OdontoService.load('rest/paciente/loadPacientes').then(function (data) {
$scope.pacientes = data.data;
/* For para formatar a data no formato certo */
for(var x = 0; x < $scope.pacientes.length; x++){
$scope.pacientes[x].dataNascimento = new Date($scope.pacientes[x].dataNascimento);
}
},function (error){
console.log(error);
});
}
I wanted the data to only change on the grid, when I saved it and not when I'm still editing.