gridstack / gridstack.js

Build interactive dashboards in minutes.
https://gridstackjs.com
MIT License
6.3k stars 1.26k forks source link

[ANGULAR] Required inputs #2727

Closed Maxime-Jolibois closed 1 week ago

Maxime-Jolibois commented 1 week ago

Subject of the issue

I use angular wrapper

When i want to add a widget with function addWidget() i can pass data with selector + input of my component { selector: 'app-text-widget', input: { content: 'Test content' }, x: 0, y: 0, h: 1, w: 1, }

If my component app-text-widget has required input @Input({ required: true }) content!: number; It can be totally ignored from the object passed to addWidget() function { selector: 'app-text-widget', input: {}, x: 0, y: 0, h: 1, w: 1, }

input: {} is OK even if my component has required input

If there a workaround/tip/something to tell Gridstack that my component HAS required input ?

Your environment

Angular: 17.3.5 Angular CLI: 17.3.5 Node: 18.18.2 Package Manager: npm 9.8.1 Gridstack: 10.1.1, OS: win32 x64 Browser: Google Chrome

Steps to reproduce

I can't provide working demo for now

Expected behavior

I would like to the code to tell me my component has required input(s)

adumesny commented 1 week ago

input is an optional field in the wrapper and not sure how you would make it require for certain selectors...