npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-libphonenumber

v1.1.0

Published

Nathan Hammond's libphonenumber ported to an angular filter

Downloads

1,863

Readme

angular-libphonenumber - AngularJS input masks for phone numbers

| Info | Badges | | ------------- | ------------- | | Version | Bower version NPM version | | License | Apache license | | Testing | Build Status Coverage Status | | Quality | Dependencies status Code Climate |

Description

angular-libphonenumber is an angular directive that can be used as an input mask. By default, all numbers are formatted in US format, but the format can be set with the country-code descriptor. It uses nathanhammond/libphonenumber as a formatter for phone number's, which calls Google's libphonenumber to format numbers as you type them.

View a demo here

Installation

Using Bower:

bower install --save angular-libphonenumber

You then must decide what version of libphonenumber you want. There are two included, and you must include one of them in your application before angular-libphonenumber:

  • dist/libphonenumber.js - only includes the libphonenumber code needed for typeahead to work
  • dist/libphonenumber.full.js - includes all libphonenumber functionality including typeahead
<!-- Use either -->
<script src="./<path_to_bower_components>/angular-libphonenumber/dist/libphonenumber.full.js" />
<!-- OR -->
<script src="./<path_to_bower_components>/angular-libphonenumber/dist/libphonenumber.js" />
<!-- THEN -->
<script src="./<path_to_bower_components>/angular-libphonenumber/dist/angular-libphonenumber.min.js" />

Then include it in your angular application:

angular.module('myModule', ['cwill747.phonenumber']);

How to Use

  • You need to get the user's country code from somewhere. Where you do that is up to you (setting, local storage, angular-translate, or just another input box):
<input type="text" ng-model="countrycode" />
  • Then you just apply the input mask to any input box:
<input type="text" ng-model="phoneNumber" phone-number country-code="countrycode" />

Support

If you are having any questions or issues getting things to work, you can:

Project's issue on GitHub should be used discuss bugs and features.

Contributing to the project

We welcome any contributions to the project. Please check the CONTRIBUTING.md for contribution guidelines.

Check out our contributors here

Development

Prepare your environment

  • Install Node.js and NPM (should come with)
  • Install global dev dependencies: npm install -g gulp karma
  • Install local dev dependencies: npm install while current directory is angular-libphonenumber repo

Build

  • Build the whole project: gulp - this will run jshint, test, and build targets

Release

  • Use GitHub's release tool to draft and publish a release. I like the format better than changelogs.