0
I’m trying to clear the text field after Ubmit, but I’m not getting it. Follow my own codes
html: Here in html, I changed from ng-model="msg" to.msg message Send
angular:
$scope.mensagem = {
msg:""
};
$scope.enviarMsg = function (mensagem) {
var enviaMsg = {
msg: mensagem,
idUsuario: $window.localStorage.getItem('idUsuario'),
idCep: $window.localStorage.getItem('idCep'),
nome: $window.localStorage.getItem('nome')
}
$http.post("http://www.vigilantescomunitarios.com/www/php/enviaMsgLogra.php", enviaMsg).success(function (data){
pegaMsgsLogra();
$scope.mensagem = {
msg:""
};
});
}
I get this message on the console:
Typeerror: $Scope.msgForm. $setPristine is not a Function
If you take that:
delete msgForm
and this$scope.msgForm = []
doesn’t work?– DiegoAugusto
No, it continues the same warning and nothing happens.
– GustavoSevero
http://jsfiddle.net/AhGDC/243/
– DiegoAugusto
This appeared on the console Typeerror: Cannot read Property '$setPristine' of Undefined
– GustavoSevero
I got it. I’m going to post here the solution
– GustavoSevero
See if this post helps you https://answall.com/questions/94951/problema-ao-tenta-pega-o-scope-do-form-com-ionic/113532#113532
– André Vicente