0
のパラメータに割り当てていない私は、角2で働いていると私は奇妙なエラーがあります:エラーTS2345:型の引数「オブジェクトが」タイプ
error TS2345: Argument of type 'Object' is not assignable to parameter of type
を、私はラインを命じることは、これを表示されます。
[0] app/category-details.component.ts(40,39): error TS2345: Argument of type 'Object' is not assignable to parameter of type '{ CategoryID: number; }'.
[0] Property 'CategoryID' is missing in type 'Object'.
[0] app/category-details.component.ts(45,39): error TS2345: Argument of type 'Object' is not assignable to parameter of type '{ CategoryID: number; }'.
これはコードです:
export class CategoryDetailComponent implements OnInit {
@Input() public category: Object;
private view: Observable<GridDataResult>;
private skip: number = 0;
constructor(private service: ProductsService) { }
public ngOnInit(): void {
this.view = this.service;
this.service.queryForCategory(this.category, { skip: this.skip, take: 5 });
}
protected pageChange({ skip, take }: PageChangeEvent): void {
this.skip = skip;
this.service.queryForCategory(this.category, { skip, take });
}
}
それは私のラインで、このエラーを示しています
this.service.queryForCategory(this.category, { skip: this.skip, take: 5 });
this.service.queryForCategory(this.category, { skip, take });
どうすればこのエラーを解決できますか?
ありがとうございます!