ng2-truncate-toggle

1.0.0 • Public • Published

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)

Package Sidebar

Install

npm i ng2-truncate-toggle

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • ravid7000