The Angular Scheduler performance is affected by two Angular-specific factors:

  1. UI updates after a change
  2. Change detection

UI Update After a Change

Changing the config always results in full Scheduler refresh (equivalent of calling .update()). This is a relatively quick operation which only draws the current viewport with the default settings and usually doesn't take longer than 200-300ms.

Changing the events results in an update of individual events (up to 10 events are changed) or an events refresh (11 or more events are changed).

Change Detection

The state of config and events is checked during every change detection cycle (handled by zone.js). The change detection cycle is fired very often - it's triggered by even a minor UI change such as a mouse move.

For small config and events object this doesn't mean any performance problem but with a growing number of resources (specified in config object) and events (events attribute) it can become a significant burden. It can affect overall UI performance (no only interaction with the Scheduler control).

You can switch to using the native API to avoid this problem.

Loading Resources

import {Component, ViewChild} from '@angular/core';
import {DayPilotSchedulerComponent} from "daypilot-pro-angular";

@Component({
  selector: 'angular2-scheduler-example',
  template: `<daypilot-scheduler [config]="config" #scheduler1></daypilot-scheduler>`
})
export class AppComponent {

  @ViewChild("scheduler1")
  scheduler: DayPilotSchedulerComponent;

  config: any = {
    timeHeaders: [
      { groupBy: "Month", format: "MMMM yyyy" },
      { groupBy: "Day", format: "d" }
    ],
    scale: "Day",
    start: "2016-11-01",
    days: 30
  }

  loadResources(resources) {
    var dp = this.scheduler.control;
    dp.resources = resources;
    dp.update();
  }  

}

You can continue using the "config" attribute for the Scheduler configuration but don't include "resources" property (it would override the value that was set directly).

Loading Events

import {Component, ViewChild} from '@angular/core';
import {DayPilotSchedulerComponent} from "daypilot-pro-angular";

@Component({
  selector: 'angular2-scheduler-example',
  template: `<daypilot-scheduler #scheduler1></daypilot-scheduler>`
})
export class AppComponent {

  @ViewChild("scheduler1")
  scheduler: DayPilotSchedulerComponent;

  loadEvents(events) {
    var dp = this.scheduler.control;
    dp.update({events: events});
  }  

}

Tutorials