Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Angular 6 : Format phone number string by country

I have a requirement to format contact no string according to country in angular 6.

For ex. for "en"(US) convert "+18882759481" into "+1 888-275-9481".

It can be done by using plugin https://github.com/jackocnr/intl-tel-input in javascript. It has utilsScript js which allows you to format with intlTelInputUtils.formatNumber function.

I have tried to implement this js through angular-cli But it doesn't provide intlTelInputUtils or it's functions.

Can anyone give me any idea about how it can be done. Is there any other plugin/js through i can achieve this?

Comments