0.0.4 • Published 3 years ago

showmoreless-ngx v0.0.4

Weekly downloads
24
License
-
Repository
-
Last release
3 years ago

Showmoreless-ngx

Showmoreless-ngx is a Angular 2+ NPM package which is used for show or hide long text.

Installation

npm i Showmoreless-ngx@latest

Usage

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 Color

Contributing

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.

License

MIT