-5

Is there any way to find the country code from my mobile number? Basically, I am working on a chat application I need to find the country code by using the mobile number. Is it possible?

VVD
  • 178
  • 1
  • 9
  • You could easy find this with a quick search: https://countrycode.org/ – PEPEGA Nov 04 '19 at 11:45
  • I don't understand why you ask this question. If you're trying to find the country code for your phone number, why ask in stack overflow? Please elaborate on your question – Sean Nov 04 '19 at 11:53
  • can you please specify the exact problem you want to solve. – Hiras Haris Nov 04 '19 at 12:06
  • Please refactor your question bo be a little more specific. Are you just trying to find out a country code then @PEPEGA s comment was already more than enough and this question does not belong here. Or are you trying to show the Country a Mobile number belongs to on your website. Then you will need to integrate an API as a service with angular. An API could be this one https://restcountries.eu/#api-endpoints-full-name – relief.melone Nov 04 '19 at 12:06
  • my problem is i try to enter without any country code mobile number in html input field then after submit. how can i get country code based on mobile, is their any script code or API. – raju katavena Nov 04 '19 at 12:36

2 Answers2

1

you can use ngx-international-phone-number package, so users can select the country and can input their phone number.

Hiras Haris
  • 468
  • 4
  • 18
0

Store in a DB country code and make a query

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459