Basisimplementierung Songlist
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {SongTypePipe} from './song-type.pipe';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [SongTypePipe],
|
||||
exports: [
|
||||
SongTypePipe
|
||||
],
|
||||
imports: [
|
||||
CommonModule
|
||||
]
|
||||
})
|
||||
export class SongTypeTranslaterModule {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import {SongTypePipe} from './song-type.pipe';
|
||||
|
||||
describe('SongTypePipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new SongTypePipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
import {Pipe, PipeTransform} from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'songType'
|
||||
})
|
||||
export class SongTypePipe implements PipeTransform {
|
||||
|
||||
transform(songTypeKey: string): string {
|
||||
switch (songTypeKey) {
|
||||
case "Worship":
|
||||
return "Anbetung";
|
||||
case "Praise":
|
||||
return "Lobpreis";
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user