Unposted Done!!

This commit is contained in:
tanshu
2020-05-14 16:33:08 +05:30
parent 0df442e541
commit 0a79b1acbb
5 changed files with 34 additions and 11 deletions

View File

@ -12,13 +12,13 @@
<!-- Date Column -->
<ng-container matColumnDef="date">
<mat-header-cell *matHeaderCellDef mat-sort-header>Date</mat-header-cell>
<mat-cell *matCellDef="let row"><a [routerLink]="['/', row.url, row.id]">{{row.date}}</a></mat-cell>
<mat-cell *matCellDef="let row"><a [routerLink]="row.url">{{row.date}}</a></mat-cell>
</ng-container>
<!-- Type Column -->
<ng-container matColumnDef="voucherType">
<mat-header-cell *matHeaderCellDef mat-sort-header>Type</mat-header-cell>
<mat-cell *matCellDef="let row">{{row.voucherType}}</mat-cell>
<mat-cell *matCellDef="let row">{{row.type}}</mat-cell>
</ng-container>
<!-- Narration Column -->

View File

@ -24,12 +24,7 @@ export class UnpostedComponent implements OnInit {
}
ngOnInit() {
this.route.data.pipe(map(
(data: { info: Unposted[] }) => {
data.info = data.info.map(x => ({...x, url: x['type'].replace(/ /g, '-').toLowerCase()}));
return data;
}
)).subscribe((data: { info: Unposted[] }) => {
this.route.data.subscribe((data: { info: Unposted[] }) => {
this.info = data.info;
});
this.dataSource = new UnpostedDataSource(this.paginator, this.sort, this.info);

View File

@ -1,7 +1,8 @@
export class Unposted {
id: string;
date: string;
voucherType: string;
url: string[];
type: string;
narration: string;
debitName: string;
debitAmount: number;