Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
angular-telephone-filter
Advanced tools
Readme
:phone: 🇺🇸 A simple AngularJS filter to clean or format a US telephone number.
Comments and Pull Requests welcome!
$ npm install angular-telephone-filter --save
$ bower install angular-telephone-filter --save
Or, include the JavaScript file in the head of your document:
<script src="/path/to/file/angular-telephone-filter.js"></script>
Include the module as a dependency of your application:
angular.module('myModule', ['bc.TelephoneFilter']);
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
);
<p>{{'4045551234' | bcTelephone:'format'}}</p>
<!-- Outputs: <p>(404) 555-1234</p> -->
<p>{{'(404) 555-1234' | bcTelephone:'clean'}}</p>
<!-- Outputs: <p>4045551234</p> -->
function myController($filter) {
const prettyNumber = '(404) 555-1234';
$filter('bcTelephone')(prettyNumber, 'clean'); // Output: 4045551234
const cleanNumber = '4045551234';
$filter('bcTelephone')(cleanNumber, 'format'); // Output: (404) 555-1234
}
npm run build
- produces production version of your library under the dist
foldernpm run dev
- produces development version of your library under the dist
folder and runs a
watcherFAQs
A simple filter to format of clean a US phone number.
The npm package angular-telephone-filter receives a total of 112 weekly downloads. As such, angular-telephone-filter popularity was classified as not popular.
We found that angular-telephone-filter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.