An open API service indexing awesome lists of open source software.

https://github.com/dashawk/angular-phone-country-prefix

Select Drop Down for country prefixes with country flags
https://github.com/dashawk/angular-phone-country-prefix

Last synced: 5 months ago
JSON representation

Select Drop Down for country prefixes with country flags

Awesome Lists containing this project

README

          

Angular directive that provides country prefixes with country name and dial code.
# Build #

Currently have no build task

# Test #

Test using karma with gulp build system

```cli
gulp test
```

# Usage #

First, include as dependency in your angular module.

```js
angular.module('myApp', ['phonePrefix']);
```

It will accept a list of countries. In your controller, declare a new scope variable.
The countryID is important since it is used to select our country flag via css.

I got the css from here (forgot the repo name). Contact me if anyone knows the source repo for the flags and the css.

```js
$scope.countries = [
{ countryID: 'au', name: 'Australia', prefix: '+61' },
{ countryID: 'us', name: 'United States', prefix: '+1' }
];
```

It can also accept a phone prefix to pre-select an item in the list
```js
$scope.currentPrefix = '+61';
```

Then in the DOM

```html

```

# Contribution #
Fork this repo and install the dependencies
```cli
npm install
bower install
```