Zusätzliche Felder
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { LegalTypePipe } from './legal-type.pipe';
|
||||
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [LegalTypePipe],
|
||||
exports: [
|
||||
LegalTypePipe
|
||||
],
|
||||
imports: [
|
||||
CommonModule
|
||||
]
|
||||
})
|
||||
export class LegalTypeTranslatorModule { }
|
||||
@@ -0,0 +1,8 @@
|
||||
import { LegalTypePipe } from './legal-type.pipe';
|
||||
|
||||
describe('LegalTypePipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new LegalTypePipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'legalType'
|
||||
})
|
||||
export class LegalTypePipe implements PipeTransform {
|
||||
|
||||
transform(legalTypeKey: string): string {
|
||||
switch (legalTypeKey) {
|
||||
case 'open':
|
||||
return 'Klärung erforderlich ';
|
||||
case 'allowed':
|
||||
return 'OK';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user