definma-ui/src/app/object.pipe.ts

13 lines
259 B
TypeScript
Raw Normal View History

2020-07-13 10:52:10 +02:00
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'object'
})
export class ObjectPipe implements PipeTransform {
transform(value: object): string {
return value ? Object.entries(value).map(e => e.join(': ')).join(', ') : '';
}
}