Installations
npm install ngx-mat-intl-tel-input
Developer Guide
Typescript
No
Module System
ESM
Node Version
16.15.0
NPM Version
8.10.0
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (72.09%)
HTML (11.65%)
SCSS (10.93%)
JavaScript (5.32%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
tanansatpal
Download Statistics
Total Downloads
1,744,158
Last Day
1,947
Last Week
8,480
Last Month
38,770
Last Year
539,789
GitHub Statistics
62 Stars
197 Commits
117 Forks
3 Watching
11 Branches
10 Contributors
Package Meta Information
Latest Version
5.0.0
Package Id
ngx-mat-intl-tel-input@5.0.0
Unpacked Size
771.99 kB
Size
341.82 kB
File Count
31
NPM Version
8.10.0
Node Version
16.15.0
Total Downloads
Cumulative downloads
Total Downloads
1,744,158
Last day
-5.9%
1,947
Compared to previous day
Last week
-17.2%
8,480
Compared to previous week
Last month
-0.2%
38,770
Compared to previous month
Last year
14.9%
539,789
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
International Telephone Input for Angular Material (NgxMatIntlTelInput)
An Angular Material package for entering and validating international telephone numbers. It adds a flag dropdown to any input, detects the user's country, displays a relevant placeholder and provides formatting/validation methods.
Supports:
- Angular 14
- Angular Material 14
- ReactiveFormsModule
- FormsModule
- Validation with libphonenumber-js
Installation
Install Dependencies
$ npm install libphonenumber-js --save
Install This Library
$ npm install ngx-mat-intl-tel-input --save
Usage
Import
Add NgxMatIntlTelInputComponent
to your component file:
1imports: [NgxMatIntlTelInputComponent];
Example
Refer to main app in this repository for working example.
1<form #f="ngForm" [formGroup]="phoneForm"> 2 <ngx-mat-intl-tel-input 3 [preferredCountries]="['us', 'gb']" 4 [enablePlaceholder]="true" 5 [enableSearch]="true" 6 name="phone" 7 describedBy="phoneInput" 8 formControlName="phone" 9 ></ngx-mat-intl-tel-input> 10</form>
1 2<form #f="ngForm" [formGroup]="phoneForm"> 3 <ngx-mat-intl-tel-input 4 [preferredCountries]="['us', 'gb']" 5 [enablePlaceholder]="true" 6 [enableSearch]="true" 7 name="phone" 8 (countryChanged)="yourComponentMethodToTreatyCountryChangedEvent($event)" // $event is a instance of current select Country 9 formControlName="phone"></ngx-mat-intl-tel-input> 10</form> 11
If you want to show the sample number for the country selected or errors , use mat-hint anf mat-error as
1<form #f="ngForm" [formGroup]="phoneForm"> 2 <ngx-mat-intl-tel-input 3 [preferredCountries]="['us', 'gb']" 4 [onlyCountries]="['us', 'gb', 'es']" 5 [enablePlaceholder]="true" 6 name="phone" 7 formControlName="phone" 8 #phone 9 ></ngx-mat-intl-tel-input> 10 <mat-hint>e.g. {{phone.selectedCountry.placeHolder}}</mat-hint> 11 <mat-error *ngIf="f.form.controls['phone']?.errors?.required" 12 >Required Field</mat-error 13 > 14 <mat-error *ngIf="f.form.controls['phone']?.errors?.validatePhoneNumber" 15 >Invalid Number</mat-error 16 > 17</form>
Options
| Options | Type | Default | Description |
| ------------------ | ---------- | ----------- | ----------------------------------------------------------------------------------- | --- |
| preferredCountries | string[]
| []
| List of country abbreviations, which will appear at the top. |
| onlyCountries | string[]
| []
| List of manually selected country abbreviations, which will appear in the dropdown. | |
| inputPlaceholder | string
| undefined
| Placeholder for the input component. |
| enablePlaceholder | boolean
| true
| Input placeholder text, which adapts to the country selected. |
| enableSearch | boolean
| false
| Whether to display a search bar to help filter down the list of countries |
| format | string
| default
| Format of "as you type" input. Possible values: national, international, default |
| describedBy | string
| undefined
| Use aria-described by with the input field |
Library Contributions
- Fork repo.
- Go to
./projects/ngx-mat-intl-tel-input
- Update
./src/lib
with new functionality. - Update README.md
- Pull request.
Helpful commands
- Build lib:
$ npm run build_lib
- Copy license and readme files:
$ npm run copy-files
- Create package:
$ npm run npm_pack
- Build lib and create package:
$ npm run package
Use locally
After building and creating package, you can use it locally too.
In your project run:
$ npm install --save {{path to your local '*.tgz' package file}}
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 4/10 approved changesets -- score normalized to 4
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/tanansatpal/ngx-mat-intl-tel-input/node.js.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/tanansatpal/ngx-mat-intl-tel-input/node.js.yml/master?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 1 npmCommand dependencies pinned
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/node.js.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
Project has not signed or included provenance with any releases.
Details
- Warn: release artifact v4.0.0 not signed: https://api.github.com/repos/tanansatpal/ngx-mat-intl-tel-input/releases/36822009
- Warn: release artifact 3.3.0 not signed: https://api.github.com/repos/tanansatpal/ngx-mat-intl-tel-input/releases/33013289
- Warn: release artifact v3.2.2 not signed: https://api.github.com/repos/tanansatpal/ngx-mat-intl-tel-input/releases/30998191
- Warn: release artifact v4.0.0 does not have provenance: https://api.github.com/repos/tanansatpal/ngx-mat-intl-tel-input/releases/36822009
- Warn: release artifact 3.3.0 does not have provenance: https://api.github.com/repos/tanansatpal/ngx-mat-intl-tel-input/releases/33013289
- Warn: release artifact v3.2.2 does not have provenance: https://api.github.com/repos/tanansatpal/ngx-mat-intl-tel-input/releases/30998191
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 24 are checked with a SAST tool
Reason
35 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-8hc4-vh64-cxmj
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-92r3-m2mg-pj97
- Warn: Project is vulnerable to: GHSA-c24v-8rfc-w8vw
- Warn: Project is vulnerable to: GHSA-8jhw-289h-jh2g
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986 / GHSA-64vr-g452-qvp3
- Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx
- Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc
Score
3.1
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to ngx-mat-intl-tel-input
ngx-mat-input-tel
An Angular Material package for entering and validating international telephone numbers. It adds a flag dropdown to any input, detects the user's country, displays a relevant placeholder and provides formatting/validation methods.
@vidalsasun/ngx-mat-intl-tel-input
ngx-mat-intl-tel-input-v16
An Angular Material package for entering and validating international telephone numbers. It adds a flag dropdown to any input, detects the user's country, displays a relevant placeholder and provides formatting/validation methods.
@timewalts/ngx-mat-intl-tel-input