angular simple line clamp. inspired by line-clamp. working fine on responsive UI. example
npm install ngx-line-clamp
import { NgxLineClampModule } from 'ngx-line-clamp';
@NgModule({
...
imports: [
...,
NgxLineClampModule
]
})
<div style="height: 100px;">
<div ngxLineClamp [text]="text">
</div>
</div>
option | description |
---|---|
text | (required) Text to use in line clamp div. |
lineCount | (option) Maximum number of lines |
parentElement | (option) A parent element with a maximum size that can extend the line clamp. (default: ngxLineClamp wrapper) |
ellipsis | (option) Abbreviation display character. (default: ...) |
textTruncated | called when text was truncated |
MIT