Skip to content

muralimallow/ng-trim-value-accessor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrimValueAccessor for Angular

Angular's missing trim input functionality (equivalent of AngularJS ng-trim)

Caveat: It's a drop-in solution, meaning it applies to all input fields as soon as this module is used.

Installation

To install this library, run:

$ npm install ng-trim-value-accessor --save

and then from your Angular AppModule:

import { NgModule } from '@angular/core';
import { TrimValueAccessorModule } from 'ng-trim-value-accessor';

@NgModule({
  imports: [
    TrimValueAccessorModule
  ]
})
export class AppModule { }

--

Note: It ignores all readonly fields. For example the following field remains untouched:

<input class="form-control" name="startDate" [(ngModel)]="model.startDate" ngbDatepicker readonly>

About

Angular's (missing) trim accessor to automatically trim values of input fields

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 100.0%