You've already forked openaccounting-web
forked from cybercinch/openaccounting-web
initial commit
This commit is contained in:
25
src/app/transaction/breadcrumbs.ts
Normal file
25
src/app/transaction/breadcrumbs.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { Account } from '../shared/account';
|
||||
|
||||
@Component({
|
||||
selector: 'breadcrumbs',
|
||||
templateUrl: 'breadcrumbs.html',
|
||||
styleUrls: ['./breadcrumbs.scss']
|
||||
})
|
||||
export class Breadcrumbs {
|
||||
@Input() account: Account;
|
||||
public accountCrumbs: Account[];
|
||||
|
||||
constructor() {
|
||||
this.accountCrumbs = [];
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
let currentAccount = this.account;
|
||||
while(currentAccount && currentAccount.depth > 0) {
|
||||
this.accountCrumbs.unshift(currentAccount);
|
||||
currentAccount = currentAccount.parent;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user