Skip to content

Instantly share code, notes, and snippets.

@fabito
Created November 11, 2012 01:36
Show Gist options
  • Save fabito/4053310 to your computer and use it in GitHub Desktop.
Save fabito/4053310 to your computer and use it in GitHub Desktop.
$scope.getCep = function() {
var req = gapi.client.buscacep.cep.get({numeroCep: $scope.numeroCep} );
req.execute(function(response) {
var cep = response.result;
$scope.cep = cep;
$scope.$apply();
});
}
$scope.searchCep = function() {
var req = gapi.client.buscacep.cep.search({term: $scope.term, fields: 'result/items(numero,logradouro)'} );
req.execute(function(response) {
var ceps = response.result;
$scope.ceps = ceps;
$scope.$apply();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment