ng2-trim-directive
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
- Install
ng2-trim-directive
.
npm i ng2-trim-directive
or using Yarn
yarn add ng2-trim-directive
- Import
InputTrimModule
to your Angular module.
;
- Add the "trim" attribute to a text input or textarea element.
or with an option: trim value only on the blur event.
note: if you use the directive with
Good luck.