Ledger now working with response_model
get_edit_url workaround found with transform clientside
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 [href]="row.url">{{row.date}}</a></mat-cell>
|
||||
<mat-cell *matCellDef="let row"><a [routerLink]="['/', row.url, row.id]">{{row.date}}</a></mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Type Column -->
|
||||
|
||||
@ -7,6 +7,7 @@ import * as moment from 'moment';
|
||||
import {DaybookDataSource} from './daybook-datasource';
|
||||
import {Daybook} from './daybook';
|
||||
import {DaybookService} from './daybook.service';
|
||||
import {map} from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'app-daybook',
|
||||
@ -33,8 +34,12 @@ export class DaybookComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { info: Daybook }) => {
|
||||
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.info = data.info;
|
||||
this.form.setValue({
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
|
||||
Reference in New Issue
Block a user