International Telephone Input With Flags and Dial Codes In Angular


A helpful JavaScript plugin called International Telephone Input converts the ordinary input into an international telephone input with a drop-down list of country flags.

When clicking the dropdown list, it lists all the countries and their international dial codes next to their flags. Ideal for international visitors of your website.

You may combine the input with the International Telephone Input with this plugin.

The user-friendly method for entering and validating foreign phone numbers is the well-known JavaScript library.

International mobile number entry and validation using an open-source Angular plugin. Any input receives a flag dropdown with a country name and phone code to offer validation and various customization options.

Let’s do coding…

To use intl-input-phone follow the below steps:

Step1 :Add Dependency

Include dependencies in your project. This plugin depends on the following:

To utilise this plugin, please include the following cdn scripts in your project. Alternatively, you can manually download the script file and include it in the index.html file’s head section.

<script src="" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
<script src=""></script>
<script src=""></script>

Step 2: Install Plugin

Run following command to terminal.

npm install intl-input-phone --save

Step 3: Import Module

Import the module IntlInputPhoneModule in app.module.ts file in import section.


import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { IntlInputPhoneModule } from 'intl-input-phone';

import { AppComponent } from './app.component';

  declarations: [
  imports: [
  providers: [],
  bootstrap: [AppComponent]
export class AppModule { }

Step 4: Update html & ts file

Copy the following code and paste it to the app.component.html and app.component.ts files respectively.


  <h4>DropDown With Country Name & Dail Code</h4>
  <intl-input-phone [ConfigurationOption]="configOption1"  ></intl-input-phone>


import { Component } from '@angular/core';
import { ConfigurationOptions,ContentOptionsEnum } from 'intl-input-phone';

  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
export class AppComponent {
  title = 'intl-input';
  configOption1 : ConfigurationOptions;

  constructor() {
    this.configOption1 = new ConfigurationOptions();
    this.configOption1.OptionTextTypes = [];

Configuration Options –


use to  set the selector for the dropdown. Default : ‘IntlPhoneNumber’.

OptionTextTypes :

Property to set which content show in option. Default : Flag, CountryPhoneCode


Property to set whether user want search option or not. Default : true


Property to set whether show all other country in dropdown as well or not, when specify custom country list in module. Default : true

IsShowToolTip :

Property to set whether tooltip is show or not. Default : true


1)  Flag
2) CountryName
3) CountryPhoneCode


Submit a Comment

Your email address will not be published. Required fields are marked *


Select Categories