New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ellipsis-angular

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ellipsis-angular

A simple ellipsis directive for Angular 15+ that cuts content and adds '…' character if HTML content is overflowed.

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25
increased by47.06%
Maintainers
1
Weekly downloads
 
Created
Source

ellipsis-angular

Live demo

Sample demo page (under construction)

What is this?

Angular 15+ directive to truncate multi-line text to the visible height. Unlike most ellipsis components this may be used with HTML content also. The end of the visible text is appended with an ellipsis symbol

Instalation

npm install ellipsis-angular

Add module import to your Angular application:

import { EllipsisAngularModule } from 'ellipsis-angular';
...

@NgModule({
  imports: [
    BrowserModule,
    ...
    
    EllipsisAngularModule
  ],

Start using directive:

<div ellipsis-angular>
...
</div>

Features

There are two options available for using ellipsis-angular.

1. Static content

You may use it with static content without any additional settings:

<div ellipsis-angular>
<!-- Static HTML content goes here ---> 
</div>

There will be ellipsis added if needed once component loads or a browser window resizes. But it will not react to any inner content change.

2. Dynamic content

You may provide [innerHTML] parameter if you want ellipsis to react on inner HTML content change:

<div ellipsis-angular [innerHTML]="someHTMLStringVariable"></div>

This way ellipsis will render someHTMLStringVariable html content and will also react on its changes.

Credits

This component is inspired by dibari/angular-ellipsis AngularJS directive made by Eric Di Bari (dibari). Please see this author on GitHub. Some code samples are reused in this directive under MIT License.

Keywords

FAQs

Package last updated on 02 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc