gauravsoni119 / ng2-tel-input

MIT License
56 stars 57 forks source link

ERROR TypeError: window.intlTelInput is not a function #50

Closed gpoulles closed 5 years ago

gpoulles commented 5 years ago

Hi,

unfortunately, ng2-tel-input is not working anymore after upgrading to the latest version 2.0.3 and intl-tel-input 16.0.2.

I'm getting the following error: ERROR TypeError: window.intlTelInput is not a function at Ng2TelInput.push../node_modules/ng2-tel-input/src/ng2-tel-input.js.Ng2TelInput.ngOnInit (ng2-tel-input.js:41)

I imported the module, and added the scripts as mentioned in the docs.

Thanks Gilles

gauravsoni119 commented 5 years ago

Hi @gpoulles , It's running fine for me. I tried it on my local. Can you console.log(window.intlTelInput) in your browser console? If it's not printing anything then, you may need to reinstall intl-tel-input package. Also, make sure that you are not getting any error on the terminal after installing the package.

Thanks, Gaurav Soni

gpoulles commented 5 years ago

Thanks for the quick reply @gauravsoni119,

indeed it works as well for me on a new angular installation.

There seems to be a conflict with "node_modules/country-select-js/build/js/countrySelect.js" which was imported in scripts as well. Removing this solved my problem.

Thanks again and keep up the good work! Gilles

akvaliya commented 5 years ago

I am getting the same error after updating to latest version. I am using this in Angular 7 project. @gpoulles can you tell me how did you resolved this error?