I want the console
value I entered in the cep
field to appear in the input
after the field loses focus.
However, my code is not doing this.
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()
});