Skip to content

keviner2004/angular2-trim-directive

 
 

Repository files navigation

ng2-trim-directive

Build Status npm

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

Usage

  1. Install ng2-trim-directive.
  npm i ng2-trim-directive
  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 element.
   <input type="text" trim />

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

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

Good luck.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 92.5%
  • JavaScript 5.0%
  • HTML 2.5%