Created
February 23, 2015 17:22
-
-
Save whatnickcodes/864504cb5a3a6ea62048 to your computer and use it in GitHub Desktop.
callback
This file contains 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
GoogleApi.geocodeAddress(vm.formData.address) | |
.success(function(data) { | |
// vm.processing = false; | |
if (data.status == 'ZERO_RESULTS') { | |
// Show Message | |
console.log('not good to goo'); | |
} else if (data.status == 'OK' && data.results.length > 1) { | |
// Show message | |
console.log('too many results'); | |
} else { | |
Affiliate.search(data.results[0].geometry.location) | |
.success(function(data) { | |
if (!data.is_success) { | |
// Show message | |
console.log('no nearby locations'); | |
} else { | |
vm.affiliates = data.results; | |
} | |
}) | |
.error(handleError); | |
} | |
}) | |
.error(handleError); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment