The latest sandbox build (8.3.2769) now supports AOT.
The Angular 2 components were moved out of the DayPilot.Angular namespace and it's necessary to use the new component names. The old components in the DayPilot.Angular namespace are still supported but they will be deprecated and eventually removed. The old components are not compatible with AOT.
Old syntax (scheduler.module.ts from https://code.daypilot.org/25443/angular-2-scheduler-read-only-and-edit-mode-switching):
import {DataService} from "./data.service";
import {HttpModule} from "@angular/http";
import {FormsModule} from "@angular/forms";
import {BrowserModule} from "@angular/platform-browser";
import {NgModule} from "@angular/core";
import {SchedulerComponent} from "./scheduler.component";
import {DayPilot} from "daypilot-pro-angular";
@NgModule({
imports: [
BrowserModule,
FormsModule,
HttpModule
],
declarations: [
DayPilot.Angular.Scheduler,
SchedulerComponent
],
exports: [ SchedulerComponent ],
providers: [ DataService ]
})
export class SchedulerModule { }
Note that the Angular 2 Scheduler component from DayPilot Pro package is in the "declarations" section (DayPilot.Angular.Scheduler).
New syntax:
import {DataService} from "./data.service";
import {HttpModule} from "@angular/http";
import {FormsModule} from "@angular/forms";
import {BrowserModule} from "@angular/platform-browser";
import {NgModule} from "@angular/core";
import {SchedulerComponent} from "./scheduler.component";
import {DayPilotModule} from "daypilot-pro-angular";
@NgModule({
imports: [
BrowserModule,
FormsModule,
HttpModule,
DayPilotModule
],
declarations: [
SchedulerComponent
],
exports: [ SchedulerComponent ],
providers: [ DataService ]
})
export class SchedulerModule { }
Note that individual declarations (such as DayPilot.Angular.Scheduler) are replaced by importing DayPilotModule ("imports" section). This automatically makes all DayPilot components available in component templates.
The following components are available:
* DayPilotSchedulerComponent (previously DayPilot.Angular.Scheduler)
* DayPilotCalendarComponent (previously DayPilot.Angular.Calendar)
* DayPilotMonthComponent (previously DayPilot.Angular.Month)
* DayPilotNavigatorComponent (previously DayPilot.Angular.Navigator)
* DayPilotGanttComponent (previously DayPilot.Angular.Gantt)
* DayPilotKanbanComponent (previously DayPilot.Angular.Kanban)
* DayPilotModalComponent (previously DayPilot.Angular.Modal)