@linch90/digit-only-directive
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

DigitOnlyDirective

A angular directive to allow digit only input.

Module

import { DigitOnlyDirectiveModule } from "@linch90/digit-only-directive";

Example

Stackblitz

<input
  type="text"
  class="form-control"
  id="digitOnlyInput"
  digitOnly
  [decimal]="true"
/>

API

Selector

input[digitOnly],textarea[digitOnly]

Name Description
decimal default: false, if support decimal
decimalSeparator '.', the separator of decimal
min -Infinity, the min value that allowed
max Infinity, the max value that allowed
pattern string | RegExp | undefined, the digit pattern that allowed

Package Sidebar

Install

npm i @linch90/digit-only-directive

Weekly Downloads

24

Version

2.0.0

License

MIT

Unpacked Size

99 kB

Total Files

14

Last publish

Collaborators

  • linch90