Frontend (Angular 2) :
Backend (Java):
Source code of the tutorial is available for download.
app.component.ts
import {Component, ViewChild, AfterViewInit} from '@angular/core'; import {DayPilot} from "daypilot-pro-angular"; import {DataService, CreateEventParams} from "./data.service"; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent implements AfterViewInit { // ... @ViewChild("scheduler1") scheduler: DayPilot.Angular.Scheduler; config: any = { timeHeaders : [ {groupBy: "Month", format: "MMMM yyyy"}, {groupBy: "Day", format: "d"} ], days: 30, startDate: "2016-11-01", scale: "Day", onTimeRangeSelected: args => { let name = prompt("New event name:", "Event"); this.scheduler.control.clearSelection(); if (!name) { return; } let params: CreateEventParams = { start: args.start.toString(), end: args.end.toString(), text: name, resource: args.resource }; this.ds.createEvent(params).subscribe(result => { this.events.push(result); this.scheduler.control.message("Event created"); } ); } }; // ... }