0.0.4 • Published 5 years ago
showmoreless-ngx v0.0.4
Showmoreless-ngx
Showmoreless-ngx is a Angular 2+ NPM package which is used for show or hide long text.
Installation
npm i Showmoreless-ngx@latestUsage
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { ShowmorelessNgxModule } from 'showmoreless-ngx';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
ShowmorelessNgxModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app.component.ts:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
paragraph = "Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
}
app.componet.html:
<lib-showmoreless-ngx [text]="paragraph" [wordLimit]="10"
[showColor]="'green'" [hideColor]="'red'"></lib-showmoreless-ngx>
#optional
[showColor] - showButtonText Color
[hideColor] - hideButtonText ColorContributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.