Moving to strict.
Create form has now moved to constructor and route data subscribe is type safe.
This commit is contained in:
@ -28,10 +28,6 @@ export class ProductDetailComponent implements OnInit, AfterViewInit {
|
||||
private toaster: ToasterService,
|
||||
private ser: ProductService,
|
||||
) {
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
code: { value: '', disabled: true },
|
||||
name: '',
|
||||
@ -49,7 +45,9 @@ export class ProductDetailComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { item: Product; productGroups: ProductGroup[] }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { item: Product; productGroups: ProductGroup[] };
|
||||
|
||||
this.productGroups = data.productGroups;
|
||||
this.showItem(data.item);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user