Daybook done!!

This commit is contained in:
tanshu
2020-05-14 12:27:15 +05:30
parent 01cf6c2da1
commit 5f783e1f45
5 changed files with 60 additions and 10 deletions

View File

@ -26,7 +26,7 @@
<!-- 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 -->

View File

@ -34,12 +34,7 @@ export class DaybookComponent implements OnInit {
}
ngOnInit() {
this.route.data.pipe(map(
(data: { info: Daybook }) => {
data.info.body = data.info.body.map(x => ({...x, url: x['type'].replace(/ /g, '-').toLowerCase()}));
return data;
}
)).subscribe((data: { info: Daybook }) => {
this.route.data.subscribe((data: { info: Daybook }) => {
this.info = data.info;
this.form.setValue({
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),

View File

@ -1,5 +1,6 @@
export class DaybookItem {
id: string;
date: string;
type: string;
narration: string;
@ -8,7 +9,7 @@ export class DaybookItem {
creditText: string;
creditAmount: number;
posted: boolean;
url: string;
url: string[];
}
export class Daybook {