section type pipe
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import {SectionTypePipe} from './section-type.pipe';
|
||||
|
||||
describe('SectionTypePipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new SectionTypePipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user