You've already forked openaccounting-web
mirror of
https://github.com/openaccounting/oa-web.git
synced 2025-12-11 08:10:43 +13:00
21 lines
401 B
TypeScript
21 lines
401 B
TypeScript
import { Pipe, PipeTransform } from '@angular/core';
|
|
|
|
@Pipe({name: 'accountName'})
|
|
export class AccountNamePipe implements PipeTransform {
|
|
constructor() {
|
|
}
|
|
|
|
transform(name: string, depth: number): string {
|
|
let parts = name.split(':');
|
|
|
|
let accountString = '';
|
|
|
|
if(!depth) {
|
|
depth = 1;
|
|
}
|
|
|
|
parts = parts.slice(depth - 1, parts.length);
|
|
|
|
return parts.join(':');
|
|
}
|
|
} |