angular-telephone-filter

Angular Telephone Filter

A simple Angular filter to clean or format a US telephone number.

Demo on Plunker

Installation

Or, include the JavaScript file in the head of your document:

Include the module as a dependency of your application:

Dependencies

  • Angular >1.4

Usage

The filter expects a single parameter to be passed in to control the filter direction. A parameter of clean will return only the numbers (ie 1235551234) while the format parameter will direct the filter to output the formatted number (ie (123) 555-1234);

Use in the DOM:

Use in a controller


Scripts

  • npm run build - produces production version of your library under the dist folder
  • npm run dev - produces development version of your library under the dist folder and runs a watcher

All idea and code contributions welcome!

comments powered by Disqus
This page was last updated about 1 year ago.