Angular-Signaturfeld | ng-hub-ui-signature
Barrierefreies Angular-Signaturfeld, das Maus-, Touch- und Stifteingaben als skalierbare SVG-Formularwerte speichert, mit Rückgängig, Wiederholen und PNG-Export.
API-Referenz
Hier ist der vollständige Vertrag für signature: alles, was du binden, abhören, projizieren und gestalten kannst, an einem Ort gesammelt. Verdrahte, was du brauchst, und gestalte, was du willst — es ist standalone und Signals-freundlich.
Inputs
Stelle signature mit 9 Inputs ein. Binde sie wie jeden Angular-@Input.
| Name | Typ | Standard | Beschreibung |
|---|---|---|---|
label | string | '' | Visible field label. |
formText | string | '' | Helper text shown below the drawing surface. |
height | number | 160 | Logical canvas height in CSS pixels. |
strokeColor | string | 'currentColor' | Colour recorded in new SVG strokes. |
strokeWidth | number | 2 | Base width recorded in new SVG strokes. |
readonly | boolean | false | Prevents drawing while preserving the signature. |
controls | boolean | true | Shows clear, undo and redo actions. |
labels | Partial<HubSignatureLabels> | {} | Overrides the application-wide translated action labels for this field only. |
ariaLabel | string | 'Signature' | Accessible name for the drawing surface. |
Outputs
Reagiere darauf, was signature tut — 1 Events, an die du deine Logik anknüpfen kannst.
| Name | Typ | Beschreibung |
|---|---|---|
valueChange | EventEmitter<string> | Emits the SVG value after a user-originated change. |
Methoden
Steuere signature aus dem Code heraus — 5 Methoden auf der programmatischen Schnittstelle.
| Name | Signatur | Rückgabe | Beschreibung |
|---|---|---|---|
clear | clear(): void | — | Removes every stroke and emits the empty value. |
undo | undo(): void | — | Removes the most recently committed stroke. |
redo | redo(): void | — | Restores the most recently undone stroke. |
toSvg | toSvg(): string | — | Returns the scalable SVG form value. |
toDataUrl | toDataUrl(type?: string): string | — | Exports the rendered signature, PNG by default. |
Templates
Noch keine Templates dokumentiert.