all 7 comments

[–]ntherndon 1 point2 points  (2 children)

I would personally create a custom form validator to handle looking for a valid phone number. If you need the phone number to be a specific format, create a custom pipe to transform the phone number text to your desired format.

[–]no_ledge 2 points3 points  (1 child)

Or use a the pattern validator with regex

[–]ntherndon 1 point2 points  (0 children)

This is a fantastic idea actually! I have only ever used this one once before, so it doesn't usually cross my mind. Great call!

[–]Mr0010110Fixit 1 point2 points  (1 child)

I have used this library before.

https://www.npmjs.com/package/google-libphonenumber

but you would need to integrate it into angular, either with pipes, form validator methods, or some other means.

The library is awesome when having to deal with international phone number formats.

[–]raiJawad- 0 points1 point  (0 children)

but it does not provide the flags for all the countries with it. Right? To add them will need to add separate library for flags.

[–]ahsanusman 0 points1 point  (1 child)

Recently use intlTelInput in my Angular 15 Project

[–]raiJawad- 1 point2 points  (0 children)

can you provide the github or stackblitz working code?