简体   繁体   中英

How to use intl-tel-input plugin utilsscript in angular 2+ Project?

  • Module : ng2-tel-input,
  • Project : Angular 4,
  • JS plugin : intl-tel-input

After installing npm i ng2-tel-input

I saw a comment inside node_modules\\intl-tel-input\\src\\js\\intlTelInput.js file saying

//specify the path to the libphonenumber script to enable validation/formatting

for utilsScript: ""

How can I use this utilsScript inside my angular project typescript file? Can someone please give a solution?

You can find how to add utilsScript on official page of that plugin https://github.com/gauravsoni119/ng2-tel-input

You just need to add utilsScript in plugin options:

[ng2TelInputOptions]="{initialCountry: 'in', utilsScript: 'node_modules/intl-tel-input/build/js/utils.js'}"

You can use this plugin - intl-input-phone.

npm i intl-input-phone

See the NPM link for more information npm

GitHub Link

Demo Link 1

Demo Link 2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM