Strict done!!
This commit is contained in:
@ -9,4 +9,18 @@ export class DaybookItem {
|
||||
creditAmount: number;
|
||||
posted: boolean;
|
||||
url: string[];
|
||||
|
||||
public constructor(init?: Partial<DaybookItem>) {
|
||||
this.id = '';
|
||||
this.date = '';
|
||||
this.type = '';
|
||||
this.narration = '';
|
||||
this.debitText = '';
|
||||
this.debitAmount = 0;
|
||||
this.creditText = '';
|
||||
this.creditAmount = 0;
|
||||
this.posted = true;
|
||||
this.url = [];
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,10 +17,10 @@ import { DaybookService } from './daybook.service';
|
||||
export class DaybookComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
|
||||
@ViewChild(MatSort, { static: true }) sort?: MatSort;
|
||||
dataSource: DaybookDataSource;
|
||||
info: Daybook = new Daybook();
|
||||
dataSource: DaybookDataSource = new DaybookDataSource(this.info.body);
|
||||
form: FormGroup;
|
||||
info: Daybook;
|
||||
selectedRowId: string;
|
||||
selectedRowId = '';
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = [
|
||||
'date',
|
||||
@ -53,7 +53,7 @@ export class DaybookComponent implements OnInit {
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate(),
|
||||
});
|
||||
this.dataSource = new DaybookDataSource(this.paginator, this.sort, this.info.body);
|
||||
this.dataSource = new DaybookDataSource(this.info.body, this.paginator, this.sort);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ const serviceName = 'DaybookService';
|
||||
export class DaybookService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
list(startDate: string, finishDate): Observable<Daybook> {
|
||||
list(startDate: string | null, finishDate: string | null): Observable<Daybook> {
|
||||
const startDateWithSlash = startDate ? `/${startDate}` : '';
|
||||
const finishDateWithSlash = finishDate ? `/${finishDate}` : '';
|
||||
return <Observable<Daybook>>(
|
||||
|
||||
@ -4,4 +4,11 @@ export class Daybook {
|
||||
startDate: string;
|
||||
finishDate: string;
|
||||
body: DaybookItem[];
|
||||
|
||||
public constructor(init?: Partial<Daybook>) {
|
||||
this.startDate = '';
|
||||
this.finishDate = '';
|
||||
this.body = [];
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user