Tel.js

A directive for input type 'tel'.

View project onGitHub

Welcome to Tel.js

This is a simple demo of tel.js.

The following input field is of type 'tel' and is validated and formatted as a phone number. You can type in any valid phone number with countrycode(fx. +45, +46 etc.) and it will automatically format it according to the country's formatting tradition.

The input will also be validated so you can take advantage of the in Angular's forms. The validation even takes valid number ranges for the specific country into consideration.

invalid valid

Try this!

If you lack data to test the validation and formatting you can try these.

'+45 22 33 44 55' is a valid in Denmark but '+45 11 22 33 44' is not, because there is no ranges there starting with '1'.

You should also try out swedish numbers which have a very diverse way of formatting. Fx. '+46 120 123 45' and '+46 11 01 23 45' are both validated and formatted correctly according to the range.