I am looking for a solution in Angular or CSS that will automatically add a "read more" button if the text is longer than 5 lines. My Angular page currently limits text to 150 characters.
{{post.post_text | limitTo:letterLimit}}
However, some posts are too long because they contain multiple line breaks:
- my post
- line 2
- line 3
- l
- i
- n
- e
While these posts are still under 150 characters, they begin to disrupt the layout of my page. I am seeking a solution that will add a "read more" button for text longer than 5 lines.
As a beginner in Angular, I am unsure where to start and would appreciate any assistance.
so far
I have only come across solutions based on character count, but I require a solution based on the number of lines or total line-height. Any help on this matter would be greatly appreciated. Thank you.