1.0.1 • Published 7 years ago
ngx-trim v1.0.1
ngx-trim
This project was generated with Angular CLI version 6.0.1.
Demo: https://stackblitz.com/github/maxisam/ngx-trim
Installation
To install this library, run:
$ npm install ngx-trim --saveConsuming your library
Once you have published your library to npm, you can import your library in any Angular application by running:
$ npm install ngx-trimand then from your Angular AppModule:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import the library
import { NgxTrimModule } from 'ngx-trim';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
// Import the library
NgxTrimModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}Once your library is imported, you can use its components, directives and pipes in your Angular application:
<!-- You can now use your library component in app.component.html -->
<input type="text" placeholder="input" [(ngModel)]="testInput" ngxTrim>Features
Trim text after input event, focusout or keyup.
You can set it as ngxTrim='focusout' or
Development
To generate all *.js, *.d.ts and *.metadata.json files:
$ npm run buildTo lint all *.ts files:
$ npm run lintAcknowledgement
This project uses generator-angular2-library
License
MIT © Sam Lin