← All pipes
Text

initials

Name badges in one expression.

Use it in your component

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

@Component({
  standalone: true,
  imports: [InitialsPipe],
  template: `{{ 'Ana María' | initials: 2: '—' }}`,
})
export class ExampleComponent {

}

Template
{{ 'Ana María' | initials: 2: '—' }}

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.
Ordered parameters: maximumWords, fallback. Locale is controlled separately.
This pipe has no locale override.
Live template data
readonly value = "Ana María";
readonly parameter0 = 2;
readonly parameter1 = "—";
{{ value | initials: parameter0: parameter1 }}

Rendered output

AM