NgDiagramClipboardService
since v0.8.0The NgDiagramClipboardService provides clipboard operations for diagram.
Example usage
Section titled “Example usage”private clipboardService = inject(NgDiagramClipboardService);
// Copy selected elementsthis.clipboardService.copy();Extends
Section titled “Extends”NgDiagramBaseService
Methods
Section titled “Methods”copy()
Section titled “copy()”copy():
Promise<void>
Copies the current selection to the clipboard.
Returns
Section titled “Returns”Promise<void>
A promise that resolves once the selection has been copied.
cut():
Promise<void>
Cuts the current selection to the clipboard.
Returns
Section titled “Returns”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()
Section titled “paste()”paste(
position,options?):Promise<void>
Pastes the clipboard content at the specified position.
Parameters
Section titled “Parameters”position
Section titled “position”The position where to paste the content.
options?
Section titled “options?”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.
waitForMeasurements?
Section titled “waitForMeasurements?”boolean
Returns
Section titled “Returns”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.