Moving to strict.
Create form has now moved to constructor and route data subscribe is type safe.
This commit is contained in:
+3
-5
@@ -23,17 +23,15 @@ export class ProductGroupDetailComponent implements OnInit, AfterViewInit {
|
||||
private toaster: ToasterService,
|
||||
private ser: ProductGroupService,
|
||||
) {
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
name: '',
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { item: ProductGroup }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { item: ProductGroup };
|
||||
|
||||
this.showItem(data.item);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -23,7 +23,9 @@ export class ProductGroupListComponent implements OnInit {
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { list: ProductGroup[] }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { list: ProductGroup[] };
|
||||
|
||||
this.list = data.list;
|
||||
});
|
||||
this.dataSource = new ProductGroupListDataSource(this.paginator, this.sort, this.list);
|
||||
|
||||
Reference in New Issue
Block a user