transform keys and text service

This commit is contained in:
2020-03-16 21:07:11 +01:00
committed by smuddy
parent 8c000867cb
commit 7d58dd9bdd
18 changed files with 335 additions and 36 deletions

View File

@@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {KeyPipe} from './key.pipe';
@NgModule({
declarations: [KeyPipe],
exports: [
KeyPipe
],
imports: [
CommonModule
]
})
export class KeyTranslatorModule {
}

View File

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

View File

@@ -0,0 +1,13 @@
import {Pipe, PipeTransform} from '@angular/core';
import {scaleMapping} from '../../../modules/songs/services/key.helper';
@Pipe({
name: 'key'
})
export class KeyPipe implements PipeTransform {
transform(key: string): string {
return scaleMapping[key];
}
}