Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1x 1x 1x 1x 1x 1x 1x 1x 1x | import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'formatCountries',
standalone: true,
})
export class FormatCountriesPipe implements PipeTransform {
transform(countries: any): string {
if (Array.isArray(countries)) {
return countries.map((country) => country.name).join(', ') || '';
}
return ''; // Return empty string if 'countries' is not an array
}
}
|