Defined in: angular/projects/lib/src/lib/base-widget.ts:39
Base widget class for GridStack Angular integration.
new BaseWidget(): BaseWidget;serialize(): undefined | NgCompInputs;Defined in: angular/projects/lib/src/lib/base-widget.ts:66
Override this method to return serializable data for this widget.
Return an object with properties that map to your component's @Input() fields. The selector is handled automatically, so only include component-specific data.
undefined | NgCompInputs
Object containing serializable component data
serialize() {
return {
title: this.title,
value: this.value,
settings: this.settings
};
}deserialize(w): void;Defined in: angular/projects/lib/src/lib/base-widget.ts:88
Override this method to handle widget restoration from saved data.
Use this for complex initialization that goes beyond simple @Input() mapping. The default implementation automatically assigns input data to component properties.
| Parameter | Type | Description |
|---|---|---|
w |
NgGridStackWidget |
The saved widget data including input properties |
void
deserialize(w: NgGridStackWidget) {
super.deserialize(w); // Call parent for basic setup
// Custom initialization logic
if (w.input?.complexData) {
this.processComplexData(w.input.complexData);
}
}| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
widgetItem? |
public |
NgGridStackWidget |
Complete widget definition including position, size, and Angular-specific data. Populated automatically when the widget is loaded or saved. | angular/projects/lib/src/lib/base-widget.ts:45 |