Feature: Added the customer module to list / edit customers. This is needed to add the customer discount functionality

This commit is contained in:
2021-04-02 06:34:31 +05:30
parent 214c40fbde
commit 0da16e9548
24 changed files with 560 additions and 7 deletions

View File

@ -0,0 +1,28 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Customer } from '../../core/customer';
import { CustomerListDatasource } from './customer-list-datasource';
@Component({
selector: 'app-customer-list',
templateUrl: './customer-list.component.html',
styleUrls: ['./customer-list.component.css'],
})
export class CustomerListComponent implements OnInit {
dataSource: CustomerListDatasource = new CustomerListDatasource([]);
list: Customer[] = [];
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['name', 'phone', 'address'];
constructor(private route: ActivatedRoute) {}
ngOnInit() {
this.route.data.subscribe((value) => {
const data = value as { list: Customer[] };
this.list = data.list;
});
this.dataSource = new CustomerListDatasource(this.list);
}
}