ng2-us-states
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

README

Angular Service for retrieving a list of States, Territories or a merged array of both

How do I get set up?

  • Import the module:
    • import { USStateModule } from 'ng2-us-states';
  • Add it as an import:
    • imports: [ USStateModule ]
  • Import in to your component:
    • import { USSateService } from 'ng2-us-states'
  • Inject it in the constructor of your component:
    • constructor(private usStateService: USStateService) {}
  • Call the methods:
    • this.usStateService.getStates();

Methods

  • getStates() //returns 50 states
  • getTerritories() // returns 9 territories
  • getAll() // returns 59 states and territories

Contribution guidelines

  • Write tests
  • Pull Request

Who do I talk to?

Readme

Keywords

Package Sidebar

Install

npm i ng2-us-states

Weekly Downloads

155

Version

3.0.1

License

MIT

Unpacked Size

21.1 kB

Total Files

33

Last publish

Collaborators

  • bwellons
  • jdjuan