Localization
listFormat
Formats readonly string lists using Intl conjunction, disjunction or unit grammar.
Use it in your component
Standalone component
import { Component } from '@angular/core';
import { ListFormatPipe } from 'extra-pipe';
@Component({
standalone: true,
imports: [ListFormatPipe],
template: `{{ ['Angular', 'TypeScript', 'Extra Pipe'] | listFormat: {type: 'conjunction'}: 'fr' }}`,
})
export class ExampleComponent {
}
Template
{{ ['Angular', 'TypeScript', 'Extra Pipe'] | listFormat: {type: 'conjunction'}: 'fr' }}
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: options. Locale is controlled separately.
Applied to the live output.
Live template data
readonly value = [
"Angular",
"TypeScript",
"Extra Pipe"
] as const;
readonly parameter0 = {"type":"conjunction","style":"long"} as const;
{{ value | listFormat: parameter0: "en-US" }}
Rendered output
Angular, TypeScript, and Extra Pipe