ng2-trim-directive-dev

v0.0.3
[![Build Status](https://travis-ci.org/anein/angular2-trim-directive.svg?branch=master)](https://travis-ci.org/anein/angular2-trim-directive) [![npm](https://img.shields.io/npm/v/ng2-trim-directive.svg)](https://www.npmjs.com/package/ng2-trim-directive)
angular ng2 directive typescript trim javascript

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 ng2-trim-directive to your Angular module.
import { InputTrimModule } from 'ng2-trim-directive';
@NgModule({
  imports: [
    ...
    InputTrimModule,
    ...
  ],
  ...

[Deprecated] 2. Add the directive to your module 'declarations' section.

  @NgModule( {
    ...
    declarations: [ ..., InputTrimDirective ],
    ...
  } )
  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.

Metadata

  • MIT
  • Whatever
  • Alexander Ein
  • released 10/23/2017

Downloads

Maintainers