Skip to content
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

Group data-bind keys by a category #366

Open
g105b opened this issue Jul 29, 2022 · 0 comments
Open

Group data-bind keys by a category #366

g105b opened this issue Jul 29, 2022 · 0 comments
Milestone

Comments

@g105b
Copy link
Member

g105b commented Jul 29, 2022

Within HTML, there might be an element that contains lots of data-binds for, say, a User, and another element that contains lots of data-binds for an Order.

The User's element might have things like "id" or "name" as bind keys, which would clash with the data within an Order.

When using bindData(), it's still really useful to refer to the direct fields of the entities (rather than changing the keys to orderId, orderName, userId, userName, etc.), so the developer has to pass a element context wherever there might be a clash.

As an improvement, an attribute like data-bind-prefix="user" could be added to the outer element, and a special character can be added to the bind key, such as data-bind:text="^id" to indicate that the key should be transformed to "userId", or data-bind:text="_id" for "user_id", for example.

@g105b g105b added this to the v4 milestone Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant