Skip to content

douglasPinheiro/ng-consult-cep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ng-consult-cep

Angularjs service to consult CEP on correios

Small lib to consult CEP on Correios

DEMO https://codepen.io/douglaspinheiro/pen/bryEpq

npm install --save ng-consult-cep

Add this app as dependence in your app

angular.module('example', ['ngConsultCEP'])

Inject service in your controller

angular.module('example').controller('mainCtrl', ['$scope', 'ConsultCEP', function($scope, ConsultCEP)

And call the function

ConsultCEP.get(cep).then(function(response) {
    var address = response.data;

    $scope.address = address.logradouro;
    $scope.neighborhood = address.bairro;
    $scope.city = address.localidade;
    $scope.state = address.uf;
    $scope.ibge = address.ibge;
});

About

Angularjs service to consult CEP on correios

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published