Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Latest commit

 

History

History
40 lines (31 loc) · 1.32 KB

README.md

File metadata and controls

40 lines (31 loc) · 1.32 KB

Angular Country State Select

Description

This Angularjs directive add 2 select boxes. One for selecting the country and one for the state. It based on the script written by Shafiul Azam

Installation

Clone this repository. After including the angular-country-state-select.js file in your app, inject 'angularCountryState' as a dependency in your AngularJS module:

angular
    .module('yourAppName', [
    'rest',
    'of',
    'your'
    'dependencies',
    'angularCountryState']);

How to use

Insert the tag in your html files :

<country-state-select></country-state-select>

To get the chosen state and country, you need to bind your model.

<country-state-select country="myCountryModel" state="myStateModel"></country-state-select>

Options

There are some other options :

  • country-label : The label for the country select box. default = "Country"
  • country-select-label : The select text in the country select box. default = "Select"
  • state-label : The label for the state select box. default = "State"
  • default-country : You can change the default country [Deprecated : if you want to set a default country, set the value in your controller]