search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Property 'makeDraggable' does not exist on type 'typeof Calendar'.

Asked by Stef
1 year ago.

This question is similar to, however, now applied to the Calendar component.

I am working with the implementation which can be downloaded from the following page:

Now I am trying to change the Scheduler to a Calendar view. This seems to work for all basic components.
In scheduler.component.ts, I am importing DayPilotCalendarComponent:

 import {DayPilot, DayPilotCalendarComponent, DayPilotSchedulerComponent} from "daypilot-pro-angular";
and adjusted the HTML template:
      <daypilot-calendar [config]="config" [events]="events" #scheduler></daypilot-calendar> 
      <!--    <daypilot-scheduler [config]="config" [events]="events" #scheduler></daypilot-scheduler>-->

This leads to a change from Scheduler to Calender (with the different functionalities correctly working).

However, adjusting the following code to enable the method makeDraggable for Calender (

@Directive({ selector: '[draggableToScheduler]' })
export class DraggableDirective implements AfterViewInit {

  @Input('draggableToScheduler') options: any;

  constructor(private el: ElementRef) { }

  ngAfterViewInit(): void {
    this.options.element = this.el.nativeElement;
    // DayPilot.Scheduler.makeDraggable(this.options);

leads to the following error: error TS2339: Property 'makeDraggable' does not exist on type 'typeof Calendar'.

Could it be that I am missing an import of the Calendar component somewhere?

Answer posted by Dan Letecky [DayPilot]
1 year ago.

The DayPilot.Calendar.makeDraggable() method was missing in the TypeScript definitions. It's now added in the latest sandbox build (2021.1.4829).

As a workaround, you can cast the DayPilot object to any:

// ...
const d = DayPilot as any;
Comment posted by Stef
1 year ago.

Thanks a lot!

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.