Editing Basics

Create, update and delete appointments through an application-owned handler.

Appointment editing

The following example demonstrates local persistence with simulated latency. Use New appointment, or activate an event and choose Edit or Delete. Delete requires a separate confirmation.

UTC

2026-11-30 – 2026-12-06

Mon, Nov 30

Tue, Dec 1

Wed, Dec 2

Thu, Dec 3

Fri, Dec 4

Sat, Dec 5

Sun, Dec 6

All day
08:0009:0010:0011:0012:0013:0014:0015:0016:0017:00

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)" />
    

Persistence ownership

NgbSchedulerMutationHandler receives a detached draft, operation kind, optional original and an AbortSignal. Return the saved event for create/update; resolve without a value for delete. The Scheduler does not mutate your events array.

Handle mutationComplete to update your events or remote cache after success. createEvent supplies an application-owned ID and initial dates. Keep IDs unique; updates must retain their ID.

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.