-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Angular wrapper example improvement #1824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
demo/angular/README.md
Outdated
| ### Usage | ||
|
|
||
| ```typescript | ||
| gridstackConfig: GridStackOptions = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is very specific to your needs... might not be best generic example, but easy enough for me to cleanup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is very specific to your needs... might not be best generic example, but easy enough for me to clean up.
Like it's mentionned in the README.md caveat section
|
|
||
| @Input() public x: number; | ||
| @Input() public y: number; | ||
| @Input() public width: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intentionally did not use width/height to conflict with DOM existing attributes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not an issue. Using [height]="42" won't collide with the native attributes. If the user wants to set native height attribute, he would do [attr.height.px]="42"
|
|
||
| @Input() public options: GridStackOptions; | ||
|
|
||
| @Output() public gridstackAdded = new EventEmitter<{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those should all be typed since they are the same - not clear why you need to pass Gridstack again (caller would have it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The caller might need the grid reference to get all the current elements and their position in it to save the user's customization. That's why I'm doing in my app.
|
Closing. A bit like you on #1820, I don't have time for this. It's up to you if you want to reopen, adjusts, and merge. |
|
Hello @lacroixdavid1, |
* better version of gridstack#1824 * moved classes to correct place, simplified htm + css to be in .ts template (only 2 files to copy now) * fixed the incorrect event handlers to pass the right set of params for each, cleanup * grid-item simpler elements (matches Nodes fields) MORE TODO....
better gridstack#1824 * we now have a much cleaner and optimized Ng wrapper, as well as documented README file * this needs fixes in the lib (upcoming release) to work correctly
Description
Please explain the changes you made here. Include an example of what your changes fix or how to use the changes.
Checklist
yarn test) (N/A)#1823