Frontmatter
| id | 3645 |
| title | Enable view model bindings into layouts |
| state | Closed |
| labels | enhancement |
| assignees | tobiu |
| createdAt | Dec 20, 2022, 10:18 AM |
| updatedAt | Dec 20, 2022, 10:28 AM |
| githubUrl | https://github.com/neomjs/neo/issues/3645 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Dec 20, 2022, 10:28 AM |
Right now, view models (model.Component) are limited to components, which also includes bindings (bind config).
It would be very useful to allow bindings inside layouts as well.
Example:
{ntype: 'card', bind: {activeIndex: data => data.activeIndex}}We could automatically switch the card layout index of a container in case a vm data prop changes.
I am not sure if there are other good use cases, but to keep it generic, I will add the required logic into
layout.Base.