https://github.com/devnix/ngcountrylist
Angular country list factory based on https://github.com/fannarsh/country-list
https://github.com/devnix/ngcountrylist
Last synced: 5 months ago
JSON representation
Angular country list factory based on https://github.com/fannarsh/country-list
- Host: GitHub
- URL: https://github.com/devnix/ngcountrylist
- Owner: devnix
- License: gpl-3.0
- Created: 2016-09-05T09:53:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-05T11:31:13.000Z (over 9 years ago)
- Last Synced: 2025-02-10T04:43:18.259Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ngCountryList
Angular country list factory based on https://github.com/fannarsh/country-list
## Examples
### Require module
```javascript
angular.module('myModule', ['ngCountryList']);
```
### Call factory from a controller
```javascript
angular.module('myModule').controller('myController', ['$countryList', function($countryList) {
}]);
```
## API
### $countryList.getCode(name)
#### Example
```javascript
$countryList.getCode('Spain'); // Output: 'ES'
```
### $countryList.getName(code)
#### Example
```javascript
$countryList.getName('ES'); // Output: 'Spain'
```
### $countryList.getNames()
Returns an array containing every country names.
#### Example
```javascript
$countryList.getNames();
```
### $countryList.getCodes()
Returns an array containing every country codes.
#### Example
```javascript
$countryList.getCodes();
```
### $countryList.getData()
Returns an object containing every country following the `{ "code": "ES", "name": "Spain" }` schema.
#### Example
```javascript
$countryList.getData();
```
Proudly sponsored by
[](http://www.ecomputer.es)