import { Component } from '@angular/core';
import { WrInitials } from 'ngwr/pipes';
@Component({ imports: [WrInitials] })
export class MyComponent {}wrInitials
Up to two initials of a name, one grapheme each.
Installation
Import the class. This entry point has no stylesheet.
Basic usage
The first two words give one initial each, upper-cased in LOCALE_ID. The rules are wrInitials() in ngwr/utils.
{{ 'Roman Khegay' | wrInitials }} <!-- "RK" -->
{{ 'Madonna' | wrInitials }} <!-- "M" -->
{{ '王小明' | wrInitials }} <!-- "王" -->Playground
AK
{{ name | wrInitials }}Customize
Name
API
| Name | Description | Type | Default |
|---|---|---|---|
wrInitials | Up to two initials of a name, one grapheme each, upper-cased in LOCALE_ID. wrInitials() from ngwr/utils with the app locale. | (value: string | null | undefined) => string | - |