Skip to content

NgDiagramClipboardService

since v0.8.0

The NgDiagramClipboardService provides clipboard operations for diagram.

private clipboardService = inject(NgDiagramClipboardService);
// Copy selected elements
this.clipboardService.copy();
  • NgDiagramBaseService

copy(): Promise<void>

Copies the current selection to the clipboard.

Promise<void>

A promise that resolves once the selection has been copied.


cut(): Promise<void>

Cuts the current selection to the clipboard.

Promise<void>

A promise that resolves once the change has been applied to the model. Inside a transaction, the promise resolves right away and the change is applied when the transaction commits.


paste(position, options?): Promise<void>

Pastes the clipboard content at the specified position.

Point

The position where to paste the content.

Optional settings. Set waitForMeasurements: true to resolve only after the pasted elements have been measured — useful before calling zoomToFit() or centerOnNode(). Available since 1.3.0.

boolean

Promise<void>

A promise that resolves once the change has been applied to the model. Inside a transaction, the promise resolves right away and the change is applied when the transaction commits.