12 lines
358 B
TypeScript
12 lines
358 B
TypeScript
import { Pipe, PipeTransform, inject } from '@angular/core';
|
|
import { TranslationService } from './translation.service';
|
|
|
|
@Pipe({ name: 'translate', pure: false, standalone: true })
|
|
export class TranslatePipe implements PipeTransform {
|
|
private svc = inject(TranslationService);
|
|
|
|
transform(key: string): string {
|
|
return this.svc.translate(key);
|
|
}
|
|
}
|