Skip to content

Angular wrapper using component+props (instead of selector+input)#3310

Merged
adumesny merged 1 commit into
gridstack:masterfrom
adumesny:master
Jul 16, 2026
Merged

Angular wrapper using component+props (instead of selector+input)#3310
adumesny merged 1 commit into
gridstack:masterfrom
adumesny:master

Conversation

@adumesny

Copy link
Copy Markdown
Member

Breaking changes: Angular wrapper only (gridstack/dist/angular)

Widget JSON fields are renamed to match the React/Vue convention, making layouts portable across all three frameworks:

- { selector: 'app-chart', input: { title: 'Revenue' } }
+ { component: 'app-chart', props: { title: 'Revenue' } }

The registration call is also renamed:

- GridstackComponent.addComponentToSelectorType([ChartComponent, TableComponent]);
+ GridstackComponent.registerComponents([ChartComponent, TableComponent]);

The static map and its type are renamed accordingly (selectorToTypecomponentMap, SelectorToTypeComponentMap). If you subclass BaseWidget and override deserialize(), replace any direct reads of w.input with w.props.

Description

Please explain the changes you made here. Include an example of what your changes fix or how to use the changes.

Checklist

  • Created tests which fail without the change (if possible)
  • All tests passing (yarn test)
  • Extended the README / documentation, if necessary

**Breaking changes: Angular wrapper only** (`gridstack/dist/angular`)

Widget JSON fields are renamed to match the React/Vue convention, making layouts portable across all three frameworks:

```diff
- { selector: 'app-chart', input: { title: 'Revenue' } }
+ { component: 'app-chart', props: { title: 'Revenue' } }
```

The registration call is also renamed:

```diff
- GridstackComponent.addComponentToSelectorType([ChartComponent, TableComponent]);
+ GridstackComponent.registerComponents([ChartComponent, TableComponent]);
```

The static map and its type are renamed accordingly (`selectorToType` → `componentMap`, `SelectorToType` → `ComponentMap`). If you subclass `BaseWidget` and override `deserialize()`, replace any direct reads of `w.input` with `w.props`.
@adumesny
adumesny merged commit 55b0a54 into gridstack:master Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant