Angular 8 input phone number with country codeAngular 8 input phone number with country code

Hello to all, welcome to therichpost.com. In this post, I will solved – intlTelInput is not a function.

From last couple of months, I am getting questions from my blog and youtube viewers that, during implement input phone number with country code, they are facing many error like below:

  • window.intlTelInput is not a function
  • intlTelInput is not a function
  • ERROR TypeError: ctx.telInputObject is not a function

Here is the proper tutorial to add input type phone number into your angular 9 application but you need to replace the component.html file with my code and that code I have mentioned in the end:

1. Here is the code, you just need to replace:

<input  type="text" ng2TelInput (hasError)="hasError($event)" (ng2TelOutput)="getNumber($event)" (intlTelInputObject)="telInputObject($event)" 
 (countryChange)="onCountryChange($event)" />





//You need to remove all the functions because first you have to declare them all in component.ts file
----To---- //For using default events you just need to declare functions into your component.ts file as well






<input  type="text" ng2TelInput  />

If you are still facing issue then please comment below.

jassa

Thank you

By therichpost

Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 19, MedusaJs, Next.js, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

46 thoughts on “Solved – intlTelInput is not a function”
  1. Hi, Im getting an error as shown as below, Im using angular 8

    Refused to apply style from ‘http://localhost:4200/path/to/intlTelInput.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.

    can u pls help?

  2. how to set 90 country code and 05552456800 to number field. I want to initialize this with these values. But how? thank you

  3. Imagine when you visit the page you see indian flag is set and number is 05552456800 , how can i set these variables into the object.

  4. I mean I want to set country code when I initialize the object. 90 is Turkey ‘s country code.

  5. Hi, Im getting same error vendor.js:1824 ERROR Error: Uncaught (in promise): TypeError: window.intlTelInput is not a function ..please help

  6. I have followed your step one by one but getting the same issue.
    intltelinput function not found.
    type of text/html (Refused to apply style from ‘http://localhost:4200/node_modules/intl-tel-input/build/css/intlTelInput.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.)
    ERROR TypeError: window.intlTelInput is not a function
    plz help

  7. yes, sir.
    I have followed the same step given in this URL.In my angular 5 version projects.

  8. that is not my project it is my client (office) project which is running on angular 5 so that I am getting an issue and I didn’t find other packages dependency.

  9. thanks .. now it’s working on my same project but how validate the number country wise.
    and save that data with fromControlName.

  10. Hi, I am using angular 8 version but get some error.

    window.intlTelInput is not a function

  11. Hi, I am setting the number for inttelinputobject, here countrycode with flag is coming but I am not getting phonenumber in input field

  12. I am having a input field of type tel it contains both country code with flag and phonenumber field, so while I am saving the number I am sending both countrycode and phonenumber in one string, while I am editing the page I am getting phonenumber as both countrycode and phonenumber.
    so I need to set the number what I get, while setting the number by using setNumber() only country code is setting, phone number is not setting

  13. Hi Thank you for the reply can you please provide the code(property for searching the country using intltelinput) so that i can implement it in my application

  14. Add utils.js in scripts,

    `”scripts”: [
    “node_modules/intl-tel-input/build/js/utils.js”
    ]`

    in angular.json file. This will solve your issue.

    1. goto angular.json file
    2. look for scripts
    3. add “node_modules/intl-tel-input/build/js/utils.js” inside the scripts along with the intlTelInput.min.js / intlTelInput.js
    4. save
    5. refresh your application

  15. its works only locally but when we try to build in server and load it it will how same error

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.