You've already forked openaccounting-web
mirror of
https://github.com/openaccounting/oa-web.git
synced 2025-12-14 01:30:45 +13:00
initial commit
This commit is contained in:
21
src/app/shared/account-name.pipe.ts
Normal file
21
src/app/shared/account-name.pipe.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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(':');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user