This is a migrated thread and some comments may be shown as answers.

DrawerItem doesn't contain 'path' property

1 Answer 170 Views
Drawer
This is a migrated thread and some comments may be shown as answers.
Milos
Top achievements
Rank 1
Milos asked on 01 Oct 2019, 09:11 AM

I am following the official example of Kendo Drawer component for Angular. First, I declared the variable

public items: Array<DrawerItem> = [];

 

Next, in constructor I have the following lines

constructor(private router: Router) {
const routes: any[] = router.config;
routes.forEach(route => {
  this.items.push({
    text: route.text,
    path: route.path ? route.path : ''
  });
});
}

It says that 'path' does not exist in type DrawerItem. Why? All Kendo examples are referencing to this property. Also, router does not contain the 'text' property. I cannot map routes with the Drawer component.

The official DrawerItem doc is at https://www.telerik.com/kendo-angular-ui/components/layout/api/DrawerItem/. It seems that DrawerItem doesn't contain the 'path' property! Somehow the examples are outdated or I'm making mistakes in undarstanding.

Thank you.

 

 

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 03 Oct 2019, 09:04 AM

Hello Milos,

Your understanding seems to be correct. The described issues are purely TypeScript-related ones. The most straight-forward approach for resolving it is using an Array<any> type or of a custom interface that includes the "path" property, and also not providing a specific "Route" type for the items in the routes config array:

https://stackblitz.com/edit/angular-mtwg2m?file=app/app.component.ts

Meanwhile, I will make sure to fix the typing of the items array input of the Drawer component to accept an array of any instead of an array of DrawerItems, and also update the site demos.

I apologize for the inconvenience.

Regards,
Dimiter Topalov
Progress Telerik

Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Drawer
Asked by
Milos
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or