1
Good afternoon, you guys! I read that by default Angularjs requires the fields to have some user interaction to perform Binding. How do I ignore this and submit what you have in the input field, even without user interaction? Thank you.
My Javascript is in hmtl itself, I use the code of this site. https://viacep.com.br/exemplo/javascript/
however, I do have a stereo file inside the controller folder (Laravel 5), called cadastro.js the save function inside the.js register is this.
"self.email = {}; self.save = Function() { var errors = []; // Validations if (!self.email.email) { .push errors('E-mail field is required'); }
if (!self.email.contato) {
erros.push('O campo Contato é obrigatório');
}
if (erros.length > 0) {
alertService.add('danger', erros);
}
else {
$uibModalInstance.close(self.email);
}
}; "
here are some of the fields within my html using Angularjs functions. "
ZIP CODEAddressee "
As far as I know, if you use ng-model, regardless of the user action it will send what exists there.
– KhaosDoctor
then, I have some input fields that are filled in by javascritpt, it happens that at the time of the model save, it does not leave the fields filled in, unless I type something in them.
– Celso Lisboa
This shouldn’t happen, try printing the fields with console.log to know if they are really filled in.
– pmargreff
If you post your code, we try to help...
– Thavia Farias