hm-read-more
AngularJS directive that limit text and adds read more / read less links to your text when it exeeds certain limit of characters. No requirements to JQuery. Angular animations are used for fade in/out.
Codepen demo
Install client side
$ bower install angular-read-more --save-dev
Note that angular-sanitize is required since this directive is allowing HTML tags to be used in text.
Run example locally
$ git clone$ npm install$ bower install$ gulp watch
Test locally
$ git clone$ npm install$ bower install$ gulp karma
How to use in HTML
Include JS script
Add the module to your app,
angular.module("app", ["hm.readmore"]);
As element
As attribute
hm-text
- full texthm-limit
- number > 0 of maximum characters before adding "..." and the more/less text. Default: unlimitedhm-more-text
- link text for read more. Default: Read morehm-less-text
- link text for read less. Default: Read lesshm-dots-class
- css class for dotshm-link-class
- css class for links of read more/read less text
License
angular-read-more is licensed under the MIT license.
Release new Github and Bower version
gulp bumpgulp buildgit add .git commit -m ""git push
Use Github UI to create new tag and release
Register bower package for the first time
bower register angular-read-more git://github.com/ismarslomic/angular-read-more.git