Fully working with the rule no explicit any

This commit is contained in:
2020-11-25 09:27:42 +05:30
parent 84535ca9bb
commit b583b90756
27 changed files with 223 additions and 155 deletions

View File

@ -11,7 +11,7 @@ import { DiscountDataSource } from './discount-datasource';
styleUrls: ['./discount.component.css'],
})
export class DiscountComponent {
list: any[] = [];
list: { name: string; discount: number }[] = [];
form: FormGroup;
dataSource: DiscountDataSource = new DiscountDataSource([]);
@ -20,12 +20,12 @@ export class DiscountComponent {
constructor(
public dialogRef: MatDialogRef<DiscountComponent>,
private fb: FormBuilder,
@Inject(MAT_DIALOG_DATA) public data: Observable<any[]>,
@Inject(MAT_DIALOG_DATA) public data: Observable<{ name: string; discount: number }[]>,
) {
this.form = this.fb.group({
discounts: '',
});
this.data.subscribe((list: any[]) => {
this.data.subscribe((list: { name: string; discount: number }[]) => {
this.list = list;
this.form.setControl(
'discounts',