Create read more link in AngularJS

前端 未结 4 1157
后悔当初
后悔当初 2020-12-28 21:58

I want to create a link with read more text. if there are more than 3 lines in a paragraph this link should be visible and clicking on this it show display all the lines.

4条回答
  •  萌比男神i
    2020-12-28 22:41

    I wanted to do the same thing, so I created a directive. Have a look here: https://gist.github.com/doukasd/0744566c5494ebc8643f

    Usage is pretty simple:

    {{veryLongText}}

    Where 100 is the character limit you want to specify.

    UPDATE: dd-text-collapse

提交回复
热议问题