master-detail grid example compile error in northwind.service.ts on method protected fetch()

1 Answer 142 Views
Grid
Stephen
Top achievements
Rank 1
Stephen asked on 23 Sep 2022, 07:59 PM

Trying to get this example to run but I can't get past these compile errors:  Any guidance?

https://www.telerik.com/kendo-angular-ui/components/grid/master-detail/

Element implicitly has an 'any' type because expression of type '"value"' can't be used to index type 'Object'.Element implicitly has an 'any' type because expression of type '"@odata.count"' can't be used to index type 'Object'.

1 Answer, 1 is accepted

Sort by
0
Martin Bechev
Telerik team
answered on 03 Oct 2022, 07:14 AM

Hi Stephen,

Indeed the errors are thrown due to the tsconfig.ts file configuration. The response needs to have a set type. A quick but not recommended fix is to set any type to the response. 

 (response: any) =>
          <GridDataResult>{
            data: response["value"],
            total: parseInt(response["@odata.count"], 10),
          }

However, the set types in the code and handling TypeScript errors, in general, are not directly related to the Kendo Angular suite and must be considered developer effort.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Stephen
Top achievements
Rank 1
Answers by
Martin Bechev
Telerik team
Share this question
or