0
I have the following code on my form:
<div class="uk-grid">
<div class="uk-width-1-1">
<button type="submit" class="md-btn md-btn-primary" ng-submit="frm.$valid && Salvar(registro2)">Submit</button>
</div>
</div>
When I click on Submit, I have the following error:
Typeerror: this. _recipeManager is null
The method Salvar
is not called, someone the reason for this mistake?
Here is the beginning of my form:
<form id="frm" class="uk-form-stacked">
controller save function
//salva ou altera registro no banco
$scope.Salvar = function (jsonTarefa) {
$scope.progressbar.start();
$scope.registro2.t0060_dt_agenda = document.getElementById('uk_dp_1').value;
if ($scope.strStatus == 0)
$scope.registro2.t0060_status = 0;
jsonTarefa.t0031_id_pessoa = $scope.selected.t0031_id_pessoa;//seleciona o id_pessoa do select
$http.post("/Tarefa/save", { jsonTarefa: jsonTarefa })
.success(function (data) {
if (data == "nosession")
window.location.href = '#/forms/login';
else if (data == "200") {
$scope.getAllRegistro($scope.strPesquisa, 0);
$scope.progressbar.complete();
$scope.registro2 = {};
$scope.frm.$setPristine();
$scope.registro2.t0060_tipo = 1;
$scope.registro2.t0060_status = 0;
}
else {
UIkit.modal.alert('<div class=\'uk-text-center\'>' + data + '<br/><img id=\'img-erro\' class=\'uk-margin-top\' style=\'width: 18%;margin-bottom: -60px;\' src=\'assets/img/spinners/erro.png\' </div>', { labels: { 'Ok': 'OK' } });
$scope.progressbar.complete();
}
})
.error(function (error) {
var str = "ERRO INESPERADO";
$scope.sendMail(error, "Erro front end zulex");
UIkit.modal.alert('<div class=\'uk-text-center\'>' + str + '<br/><img id=\'img-erro\' class=\'uk-margin-top\' style=\'width: 18%;margin-bottom: -60px;\' src=\'assets/img/spinners/erro.png\' </div>', { labels: { 'Ok': 'OK' } });
$scope.progressbar.complete();
});
};
Celsom, the error continues, in fact the code was as you said, I did a test, and I ended up copying the wrong code. I do not know why this error.
– alessandre martins
@alessandremartins as is the vunção
Salvar()
on your controller?– celsomtrindade
Celsom, I edited the post and put the save function
– alessandre martins
@alessandremartins If at the very beginning of the function you put
console.log('rodou")
it displays the message in the log?– celsomtrindade
Celsom, did not run... I’m using the Altair template, and axo is problem with the template.
– alessandre martins
The form and the call as explained would be correct. It’s probably something that isn’t linking the controller to the view. Try to check this because the error refers to something that is not defined.
– celsomtrindade