The bsWordCount pipe returns the number of whitespace-separated words in a string.
<textarea rows="8" [(ngModel)]="text"></textarea>
<span>{{ text | bsWordCount }}</span>
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BsWordCountPipe } from '@mintplayer/ng-bootstrap/word-count';
@Component({
selector: 'my-word-count-demo',
templateUrl: './my-word-count-demo.component.html',
imports: [FormsModule, BsWordCountPipe],
})
export class MyWordCountDemoComponent {
protected text = 'The quick brown fox jumps over the lazy dog';
}