ngx-read-more

1.0.0 • Public • Published

Read More(toogle text) directive for angular2

This is a simple toogle text directive for angular2

At first step you need mark your text-div and get him id like "read-more" if in you need use it with ngFor - "read-more{{i}}"

EXAMPLE

import { Component } from '@angular/core'; @Component({ selector: 'app-root', template: `

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Provident reiciendis voluptate

`, styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'app works!'; }

Then create your button event element

  1. Add attribute "read more"
  2. Set length of text that we need show by default
  3. Set element that we need cut
  4. Here is your buttons less and more u can inset whetewer but there are must be 2 elements with classes ".more" and ".less"

Package Sidebar

Install

npm i ngx-read-more

Weekly Downloads

207

Version

1.0.0

License

ISC

Last publish

Collaborators

  • oneia