Clamp The Long Content Of An Element – ngx-clampy

Author: clampy-js
Publish Date:
Official Page: Go to website
Views Total: 285
License: MIT

Description:

Angular (2+) directive that clamps the content of an element by adding an ellipsis to it if the content inside is too long.

It automatically re-clamps itself when the element or the browser window change size.

You can also listen to ‘originalContent’ event which is emitting the original vlue uppon clamping. This can be useful if you want to display the original content in a tooltip for instance.

Installation:

# NPM
$ npm install @clampy-js/ngx-clampy --save

Preview:

ngx-clampy

Leave a Reply