section type pipe

This commit is contained in:
2020-04-01 14:20:46 +02:00
committed by smuddy
parent 643f3aff43
commit 797b585395
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import {SectionTypePipe} from './section-type.pipe';
describe('SectionTypePipe', () => {
it('create an instance', () => {
const pipe = new SectionTypePipe();
expect(pipe).toBeTruthy();
});
});

View File

@@ -0,0 +1,20 @@
import {Pipe, PipeTransform} from '@angular/core';
import {SectionType} from '../../../modules/songs/services/text-rendering.service';
@Pipe({
name: 'sectionType'
})
export class SectionTypePipe implements PipeTransform {
transform(value: SectionType): string {
switch (value) {
case SectionType.Verse:
return 'Strophe';
case SectionType.Chorus:
return 'Refrain';
case SectionType.Bridge:
return 'Bridge';
}
}
}