Daybook done!!
This commit is contained in:
@ -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 -->
|
||||
|
||||
@ -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(),
|
||||
|
||||
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user