Skip to content

L-Triple-O/ng2-truncate-toggle

 
 

Repository files navigation

ng2-truncate-toggle

Installation

  1. You can install ng2-truncate-toggle using npm
npm install ng2-truncate-toggle --save

API

Import

import { NgTruncateToggle } from 'ng2-truncate-toggle';

// In your App's module:
imports: [
   NgTruncateToggle
]

Usage

{{ longString | truncate: 20 }}

Truncate with controls

<truncate-text
    [source]="sourceString"
    [max-length]="100"
></truncate-text>

All options for truncate controls

<truncate-text
    [show-less-text]="'Less'"
    [show-more-text]="'More'"
    [source]="sourceString"
    [max-length]="100"
    [elipse]="..."
    [show-controls]="true"
></truncate-text>

Event

<truncate-text
    (onChange)="callback($event)"
></truncate-text>

onChange: Fires when you toggle text with controls.

Thanks for understanding!

License

The MIT License (see the LICENSE file for the full text)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 80.8%
  • JavaScript 19.2%