Socket
Socket
Sign inDemoInstall

ionic-tel-input

Package Overview
Dependencies
6
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ionic-tel-input

ionic wrapper for ionic intl-tel-input library


Version published
Maintainers
1
Install size
2.49 MB
Created

Readme

Source

ionic wrapper for intl-tel-input-mobile

Installation

Run following command to install ionic-tel-input

npm install ionic-tel-input intl-tel-input-mobile --save

After install, you need to add intlTelInput.css.

In case of ionic, add intlTelInput.css in your variables.scss. For example,

  • @import 'intl-tel-input-mobile/build/css/intlTelInput.css';

  • .iti-flag {background-image: url("../assets/imgs/flags/flags.png");}

  • @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { .iti-flag {background-image: url("../assets/imgs/flags/flags@2x.png");} }

  • add flags folder in assets/imgs folder

  • replace flags folder in intel-tel-input by flags folder exist in module

Now add ionicTelInputModule into your AppModule. For example,

import { ionicTelInputModule} from ' ionic-tel-input';

Once done, we are ready to use this library.

How to use?

In order to use this directive, you need to add " ionicTelInput" directive with "[ ionicTelInputOptions]" options to your text field. For example,

<input type="text"
   ionicTelInput
  [ionicTelInputOptions]="{initialCountry: 'in'}"
  (hasError)="hasError($event)"
  ( ionicTelOutput)="getNumber($event)"
  (intlTelInputObject)="telInputObject($event)"
  (countryChange)="onCountryChange($event)" />

Note

  • this module used the following module as a reference

    • ng2-tel-input
  • modifying the style to meet the ionic mobile style

  • modifying the wrapper to refer to the jquery file

  • modifying the flags files to meet ionic mobile app

  • (intlTelInputObject) returns original element which hold intl-tel-input-mobile instance.

How to use this instance?

You can use it perform any functionality that is available on intl-tel-input-mobile plugin. For example, in your component,

telInputObject(obj) {
    console.log(obj);
    obj.intlTelInput('setCountry', 'in');
  }

N|Solid

FAQs

Last updated on 24 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc