Reactive Forms

Validate appointment drafts before calling your persistence handler.

Draft validation and retry

The following example demonstrates the built-in reactive editor. Try an empty title or an end before the start; invalid drafts never reach the handler. Enable a failed request before opening the editor to test recovery.

UTC

2026-12-02 – 2026-12-08

Wed, Dec 2

Thu, Dec 3

Fri, Dec 4

Sat, Dec 5

  • No events

Sun, Dec 6

  • No events

Mon, Dec 7

  • No events

Tue, Dec 8

  • No events

No changes saved · Requests: 0 · Appointments: 12

      readonly persist: NgbSchedulerMutationHandler = async (request, signal) => {
  // Application-owned service: enforce authorization, conflicts and idempotency.
  if (request.kind === 'delete') {
    await this.appointments.remove(request.event.id, signal);
    return;
  }
  return this.appointments.save(request.event, signal);
};
// <ngb-scheduler [date]="date" [events]="events"
//   [mutationHandler]="persist" [createEvent]="create"
//   (mutationComplete)="updateLocalEvents($event)" />
    

Validation and date fields

The default editor uses Angular reactive controls for title, description, all-day status, start and end. Title and dates are required, and end must follow start. Timed fields use UTC by default; configure an event or editing zone on the Timezones page. All-day dates use an exclusive end. Resource assignments are preserved. Use the Custom Edit Form page for a form factory and field template; resource pickers remain planned.

A failed request keeps the draft open. Correct it or retry; Cancel discards an unsaved draft. While a request is pending, controls and dismissal are disabled to prevent duplicate operations. Closing the page aborts the request signal, but your backend must still handle idempotency and uncertain outcomes.

Restrictions and focus

editPolicy can reject an action with a user-facing reason. It runs on opening and again on submission. If the loaded original has changed, cancel and reopen the editor. Enforce authorization and concurrency checks on the server too.

The editor uses a native modal dialog with labeled fields. Tab moves through its controls; Escape cancels when idle. Closing restores the appointment or a stable Scheduler control. Editing is opt-in through mutationHandler. Custom and external forms use the same pipeline. UTC timed/all-day movement and resource reassignment are available in the Drag and Drop Scheduling example. The Recurring Events example maps occurrence edits to exceptions and enables Entire series through a separate series handler. The dialog validates recurrence controls when saving the series.