Import
import { WrTruncate } from 'ngwr/pipes';
@Component({ imports: [WrTruncate] })
export class MyComponent { /* ... */ }Basic usage
Strings shorter than the limit pass through untouched.
{{ longText | wrTruncate: 24 }} <!-- "Lorem ipsum dolor sit a…" -->Custom ellipsis
Third argument replaces the default ….
{{ longText | wrTruncate: 24 : ' [more]' }}Playground
Lorem ipsum dolor sit am…
{{ text | wrTruncate: 24 : '…' }}Customize
Text
Length 24
Ellipsis
API
| Name | Description | Type | Default |
|---|---|---|---|
wrTruncate | Clamp string length with optional ellipsis. | (value: string | null | undefined, length = 80, ellipsis = '…') => string | — |