Strict done!!
This commit is contained in:
@@ -16,10 +16,10 @@ import { ProfitLossDataSource } from './profit-loss-datasource';
|
||||
export class ProfitLossComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
|
||||
@ViewChild(MatSort, { static: true }) sort?: MatSort;
|
||||
dataSource: ProfitLossDataSource;
|
||||
info: ProfitLoss = new ProfitLoss();
|
||||
dataSource: ProfitLossDataSource = new ProfitLossDataSource(this.info.body);
|
||||
form: FormGroup;
|
||||
info: ProfitLoss;
|
||||
selectedRowId: string;
|
||||
selectedRowId = '';
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['group', 'name', 'amount', 'total'];
|
||||
|
||||
@@ -39,7 +39,7 @@ export class ProfitLossComponent implements OnInit {
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate(),
|
||||
});
|
||||
this.dataSource = new ProfitLossDataSource(this.paginator, this.sort, this.info.body);
|
||||
this.dataSource = new ProfitLossDataSource(this.info.body, this.paginator, this.sort);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -56,11 +56,9 @@ export class ProfitLossComponent implements OnInit {
|
||||
prepareSubmit(): ProfitLoss {
|
||||
const formModel = this.form.value;
|
||||
|
||||
return {
|
||||
return new ProfitLoss({
|
||||
startDate: moment(formModel.startDate).format('DD-MMM-YYYY'),
|
||||
finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'),
|
||||
body: [],
|
||||
footer: { group: null, name: null, amount: null, total: null },
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user