1
I want it to be shown on console
the value cep
I typed in the field input
after the field loses focus.
But this code of mine is not doing that.
html:
<body ng-controller="appController">
<div align="center">
<form>
<label>CEP </label><br>
<input type="text" ng-model="endereco.cep" ng-blur="pegaCep(endereco)"><br>
<label>Estado </label><br>
<input type="text" ng-model="endereco.estado"><br>
</form>
</div>
</body>
Angular:
app.controller('appController', function ($scope, $http){
var pegaCep = function (data) {
console.log(data);
}
pegaCep()
});
Gustavo, I imagine your question already has an answer here: http://answall.com/questions/108712/duvida-com-angularjs-input-e-metodo-onblur/108713#108713.
– Samir Braga
The code of this other post, for me, did not work... Kept appearing on the console that my pegaCep had not been defined.
– GustavoSevero