npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

ng2-trim-directive

2.3.2 • Public • Published

ng2-trim-directive

Build Status npm

The directive trims whitespaces from the end of an input text value.

Demo

Play with the directive here https://anein.github.io/angular2-trim-directive/.

Usage

  1. Install ng2-trim-directive.
  npm i ng2-trim-directive

or using Yarn

  yarn add ng2-trim-directive -D
  1. Import InputTrimModule to your Angular module.
import { InputTrimModule } from 'ng2-trim-directive';
@NgModule({
  imports: [
    ...
    InputTrimModule,
    ...
  ],
  ...
  1. Add the "trim" attribute to a text input or textarea element.
   <input type="text" trim />
   <textarea ... trim ></textarea>

or with an option: trim value only on the blur event.

   <input type="text" trim="blur" />
   <textarea ... trim="blur" ></textarea>

note: if you use the directive with


Good luck.

install

npm i ng2-trim-directive

Downloadsweekly downloads

1,361

version

2.3.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability