appirio-tech/angular-ellipsis

Name: angular-ellipsis

Owner: Topcoder

Description: Angular directive to truncate multi-line text to visible height

Forked from: dibari/angular-ellipsis

Created: 2016-01-28 09:11:50.0

Updated: 2016-01-28 09:11:51.0

Pushed: 2016-01-04 10:53:19.0

Homepage:

Size: 464

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

angular-ellipsis

Angular directive to truncate multi-line text to visible height. The end of the visible text is appended with an ellipsis, optional text, and optional click callback function.

To use, copy src/angular-ellipsis.js to your project and rename the included module (which is set to 'exampleApp' at the bottom) to your own module.

Or, to install via Bower:

r install angular-ellipsis

and then inject into your app:

myApp = angular.module('myApp', ['dibari.angular-ellipsis']);
DEMO

Angular Ellipsis Directive demo page

FEATURES
BASIC USAGE
  1. Select an HTML element that has a CSS height or max-height value set (max-height will take precedence)
  2. Use ng-bind on the element to include text to truncate
  3. Add the ellipsis/data-ellipsis directive to the element
  4. Text will be truncated to visible area, and an ellipsis (…) will be added to the end
Simple example

<p data-ng-bind="paragraphText" data-ellipsis></p>

OPTIONS
COMPATIBILITY

Works on modern web browers, which includes any relatively recent version of Chrome, Firefox, Safari, and IE 9+. Although there is no formally-maintained list, mobile device support is quite thorough. I will update cross-browser and device issues if they are entered as issues.

TODO's

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.