Strict done!!
This commit is contained in:
@ -4,4 +4,13 @@ export class PurchasesItem {
|
||||
rate: number;
|
||||
amount: number;
|
||||
url: string[];
|
||||
|
||||
public constructor(init?: Partial<PurchasesItem>) {
|
||||
this.name = '';
|
||||
this.quantity = 0;
|
||||
this.rate = 0;
|
||||
this.amount = 0;
|
||||
this.url = [];
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,10 +17,10 @@ import { PurchasesItem } from './purchases-item';
|
||||
export class PurchasesComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
|
||||
@ViewChild(MatSort, { static: true }) sort?: MatSort;
|
||||
dataSource: PurchasesDataSource;
|
||||
info: Purchases = new Purchases();
|
||||
dataSource: PurchasesDataSource = new PurchasesDataSource(this.info.body);
|
||||
form: FormGroup;
|
||||
info: Purchases;
|
||||
selectedRowId: string;
|
||||
selectedRowId = '';
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['product', 'quantity', 'rate', 'amount'];
|
||||
|
||||
@ -40,7 +40,7 @@ export class PurchasesComponent implements OnInit {
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate(),
|
||||
});
|
||||
this.dataSource = new PurchasesDataSource(this.paginator, this.sort, this.info.body);
|
||||
this.dataSource = new PurchasesDataSource(this.info.body, this.paginator, this.sort);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ const serviceName = 'PurchasesService';
|
||||
export class PurchasesService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
list(startDate: string, finishDate): Observable<Purchases> {
|
||||
list(startDate: string | null, finishDate: string | null): Observable<Purchases> {
|
||||
const startDateWithSlash = startDate ? `/${startDate}` : '';
|
||||
const finishDateWithSlash = finishDate ? `/${finishDate}` : '';
|
||||
return <Observable<Purchases>>(
|
||||
|
||||
@ -5,4 +5,12 @@ export class Purchases {
|
||||
finishDate: string;
|
||||
body: PurchasesItem[];
|
||||
footer: PurchasesItem;
|
||||
|
||||
public constructor(init?: Partial<Purchases>) {
|
||||
this.startDate = '';
|
||||
this.finishDate = '';
|
||||
this.body = [];
|
||||
this.footer = new PurchasesItem();
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user