@ng-kit/us-phone-format
v1.0.2
Published
A angular filter that converts string to us phone format.
Downloads
6
Readme
ng kit US Phone Format
ng-kit US Phone Format is an angular $filter that converts strings to US phone format.
Development
To create a environment from scratch, install all the following dependencies.
NVM and NPM
nvm install 5
NPM global packages
npm install -g [email protected] [email protected] [email protected]
Usage
This filter expects a single string of only numbers, e.g. 5551234567
and converts it to (555) 123-4567
.
In Template
<p>{{'5551234567' | usPhoneFormat}}</p>
<!-- Outputs <p>(555) 123-4567</p> -->
In Controller
function exampleController($filter) {
$filter('usPhoneFormat', '5551234567'); // Outputs (555) 123-4567
};