← All pipes
Text

wordCount

Content word counters using locale segmentation.

Use it in your component

Standalone component
import { Component } from '@angular/core';
import { WordCountPipe } from 'extra-pipe';

@Component({
  standalone: true,
  imports: [WordCountPipe],
  template: `{{ "Hello world" | wordCount }}`,
})
export class ExampleComponent {

}

Template
{{ "Hello world" | wordCount }}

Try it live.

The output below runs the packed library. Edit data, not code.

Use double quotes for text, or a number, array, object or null.
No parameters: use []. Locale is controlled separately.
Applied to the live output.
Live template data
readonly value = "Hello world";

{{ value | wordCount: "en-US" }}

Rendered output

2