angular-ziptastic
Ziptastic ZIP -> City/State lookups for Angular
Installation
# use npm $ npm install angular-ziptastic# or bower $ bower install angular-ziptastic
Setup
Include 'ziptastic'
in your module's dependencies:
// node module exports the string 'ziptastic' for convenienceangular;// otherwise, include the code first then the module nameangular;
API
ziptasticProvider
base(baseUrl)
-> undefined
Sets the default base URL for requests. Defaults to 'https://zip.getziptastic.com/v2'
.
country(country)
-> undefined
Set the default country to use in requests. Defaults to 'US'
.
$http(config)
-> undefined
Set default config
for $http
. Defaults to undefined
. config
is an object that will be passed directly to $http
and can be used to set config options like timeout
and cache
ziptastic
lookup(code|options)
-> promise
Performs a Ziptastic lookup, either with a code
string or an options
object that specifies:
code
(string): The postal codecountry
(string): Overrides the default countrybase
(string): Overrides the default base$http
(object): Overrides the default$http
configuration
Returns a $q
promise for the Ziptastic response.
ziptastic ;