Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nativescript-maskedinput-ng2

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nativescript-maskedinput-ng2

A nativescript mask input for Angular 2

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

A {N} Masked Input Plugin

License npm npm GitHub release

This plugin extends the {N} TextView to allow for input masking.

Notes

iOS 7+

Android API 17+

Plugin does not support the use of the keyboardType property from TextView.

Plugin will attempt to determine the mask type and display the appropriate keyboardType automatically.

Installation

Run tns plugin add nativescript-maskedinput-ng2

Usage

To use MaskedInput you need to include it in your XML.

Add the following to your page directive.

xmlns:mi="nativescript-maskedinput-ng2"

Use MaskedInput by adding the following XML.

<mi:MaskedInput mask="1-999-999-9999? x999" hint="1-555-555-5555" placeholder="#" />

Properties

mask [string]

Get or Set the mask used for input

mask options
  • 9 is the same as RegEx [0-9]
  • a is the same as RegEx [A-Za-z]
  • * is the same as RegEx [A-Za-z0-9]
  • ? specifies that anything after the ? is optional.
Supported Seperators
  • |
  • /
  • \
  • .
  • $
  • ( )
  • [ ]
  • { }
valid [boolean]

Returns true or false if the input text matches the mask.

Use the FormattedText property or the text property to validate the input.

placeholder [string]

Gets or Sets the placeholder.

Default: _

RawText [string]

Gets only the text that matches the RegEx pattern from the mask.

You cannot validate the RawText property. It will fail.

FormattedText [string]

Gets the Full text including any seperators as specified in the mask.

regEx [string]

Gets the regex that was created from the mask so that you can perform your own validation.

Keywords

FAQs

Package last updated on 12 May 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc