Created
November 11, 2012 01:36
-
-
Save fabito/4053310 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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